Current File Size?

Tags: #<Tag:0x00007fbc80e02a10>

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’?

1 Like

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

Actually for feature requests like this best open a ticket on https://tickets.metabrainz.org/projects/PICARD/issues/ . And of course you are welcome to give this a go at implementing this!

2 Likes