There’s internal variables for _filename, _dirname, _extension…
I’m contemplating a _filesize for viewing in a column.
The file/directory name values appear to be set in file.py… If I were to figure out how to do the same for filesize, would I need to do anything more elsewhere to make that a globally available internal variable so that I can get it, say in album.py or cluster.py, or should it ‘just work’?
It should basically just work like e.g. the ~bitrate or other file variables. Only special case would be to also add it to File._saving_finished.
A few considerations:
This variable should also be used then in infodialog.py format_file_info
I would probably store the actual bytes here. In this case the column functions for file should probably take care of format it to a more readable value using the bytes2human.binary function
It would be nice to expose bytes2human functions also as tagger script functions then, so people can get formatted version of the size for display
Now figure out the right way to format the number.
Though I might like to see the actual number to the last digit too but it would be ridiculous with significantly larger files.
elif column == '~filesize':
size = len(self.filesize)
if not size:
return ''
return '{:d}'.format(self.metadata.filesize() / (1024 * 1024)) + 'Mb'
Of course that doesn’t work. I’ve not progressed past brute force program like a parrot (copy/paste/edit) with variables completely, and that self thing is still not quite clear to me.
I’m still not getting something here. I can’t figure out the difference between the Cat # and Media, Size Columns. I added them the same way. Or for that matter, I’m not even seeing the difference from Album vs. Cluster viewing. Cluster will at least show the additional data with only the one track listing in the treeview.