beetbox / mediafile

elegant audio file tagging
http://mediafile.readthedocs.io/
MIT License
97 stars 24 forks source link

File-like objects support #45

Closed JuniorJPDJ closed 2 years ago

JuniorJPDJ commented 3 years ago

and simple and useful MediaFile.as_dict() function

Resolves #35

sampsyo commented 3 years ago

Thanks for getting this started! If you're interested in changing path to filename, perhaps we should do that in a separate PR so it's easier to review the core of the "file-like object" feature separately? (In general, for me, I find it's easier to fully understand one change at a time.)

JuniorJPDJ commented 3 years ago

It's connected as in case of FileThing it doesn't have to be path already but it will always be some sort of file name. I can split it to separate commits for you if it's gonna make review easier ;D

sampsyo commented 3 years ago

That would be awesome, if you don't mind!

JuniorJPDJ commented 3 years ago

Done! If possible - I'd like to get your review and merge on #42 first tho.

JuniorJPDJ commented 3 years ago

Rebased on top of master.

JuniorJPDJ commented 3 years ago

I think I fixed most of issues you asked about ;D

JuniorJPDJ commented 3 years ago

I re-added MediaFile.path as @property - I don't want to completely break backwards compatibility.

It should be compatible with most of existing software now, as far as someone don't set path in their code. I don't see a point of doing this anyway as afaik it didn't change anything - saving still worked on previous file.

JuniorJPDJ commented 3 years ago

.

sampsyo commented 3 years ago

Just returning to this PR after a long delay—is everything in order from your perspective, @JuniorJPDJ? Maybe we should add something to the documentation about this new capability so people know they can use it with open files?

JuniorJPDJ commented 3 years ago

IMO it's enough. @up is line describing it If you think it's not enough - tell me please what exactly would you like to see.

JuniorJPDJ commented 2 years ago

bump

sampsyo commented 2 years ago

Thanks for your patience! This all looks great. I have updated some documentation and will merge now. :sparkles: