Curiosity got me … Looked at the Add Column Plug-in … and … !!! That’s all to add a column? That’s Nuts.
So, is there a variable that represents the number of tracks that works in that space?
…and as for why the Add Album Column can’t be disabled. But it -can- be removed. It’s literally a wedged in hack.
Looking at it, and adding to it:
from picard.ui.itemviews import MainPanel #MainPanel.columns.append((N_('Matched'), 'matched')) #MainPanel.columns.append((N_('Album'), 'album'))
Dis/enable lines as desired - the biggest question being, is there a ‘variable’ that represents the number of matched tracks for that album that can be placed there? Stabbing around in the dark, just putting various things in there, that some seem to work, many do not, and a few will just crash it.
Moving that into
itemviews.py directly … I see how the plug-in is a literal wedged in hack.
"Hey you! Let me see your list! (/me adds something to it)
Okay, you can have it back. (snicker, he’ll never notice I added that myself! )
columns = [
(N_('Matched'), 'matchedtracks'), # whatever would be appropriate ..
…and I presume that if a tick box in Options were applied to
(N_('Album'), 'album'), that would be en/disable at will.
Which brings me to
Here is where the columns are being populated.
With changes to the (x/y); x images to be only (x images) at the top and need to be added at the end.
def column(self, column):
if column == 'title':
if self.status is not None:
title = self.status
title = self.metadata['album']
linked_tracks = 0
for track in self.tracks:
linked_tracks += 1
text = title
# text = '%s\u200E (%d/%d' % (title, linked_tracks, len(self.tracks))
# CoverArt.set_metadata uses the orig_metadata.images if metadata.images is empty
# in order to show existing cover art if there's no cover art for a release. So
# we do the same here in order to show the number of images consistently.
metadata = self.metadata
metadata = self.orig_metadata
number_of_images = len(metadata.images)
if getattr(metadata, 'has_common_images', True):
text += ngettext(" (%i image)", " (%i images)",
number_of_images) % number_of_images
text += ngettext(" (%i image not in all tracks)", " (%i different images among tracks)",
number_of_images) % number_of_images
elif column == '~length':
length = self.metadata.length
#### This needs to get broken into two and show up in the tracks / matched columns.
#### I've gotten this far. ... But I'm up agaist a wall with this part.
text = '(%d/%d' % (linked_tracks, len(self.tracks))
unmatched = self.get_num_unmatched_files()
text += '; %d?' % (unmatched,)
unsaved = self.get_num_unsaved_files()
text += '; %d*' % (unsaved,)
elif column == 'album':
elif column == 'artist':
elif column == 'tracks':
elif column == 'matched':
# Reference for putting back values in new columns
# unmatched = self.get_num_unmatched_files()
# text = '%s <-> (%d|%d' % (title, linked_tracks, len(self.tracks))
# if unmatched:
# text += '; %d?' % (unmatched,)
# unsaved = self.get_num_unsaved_files()
# if unsaved:
# text += '; %d*' % (unsaved,)
How I interpret that is within that Definition there are two sets of things going on.
First, it populates the data for line title, with the graphic icon, the Album Name, Length and Artist Columns.
While data is being fetched from the DB
Title is temporarily defined as
[loading album information]
Once Album data is fetched,
title is now populated as Album Name with the text for the amount of tracks matched, saved/not saved and sum of the amount of images retrieved is appended so we see
(O) Album Name (x/y; z image(s)) as a single string being echoed in the title column.
As a sub-set to the Bold Text Title Length Artist line, the album tracks are populated below in a loop form until there are no more to display.
…and then it’s done with that last
So a Column added to MainPanel as above will result in that column being populated at the ‘sub-set’ point where the
tracktitle etc are being echoed.
First I would like to move that Album Title from the ‘sub-set’ lines (the individual tracks) to the top line so that we see all in one line:
Title. .................... Tracks | Match | Len | Artist | Album
(O) Album Name (z image(s)).. 15 ... 14 ... 3m42s . B-52's . AlbumName
.. ♫ 01 . Track Title ......................1m02s
.. ♫ 02 . Track Title ......................2m40s
(O) Next Album (z image(s)).. 20 ... 20 ... 3m42s . B-47's . Kaboom!
With just the quick slick wedge method I can get the
album columns populated. I can’t find a variable that would stand in for
I presume that i’ll need to add a
elif column == 'matched' and then attach that value to it, which I believe is already available as
Now I’m hung up on trying to restore the values to the new columns, and to get
totaltracks show on the top line.
# at the comment that says This needs to be broken up into two ..