meeb / tubesync

Syncs YouTube channels and playlists to a locally hosted media server
GNU Affero General Public License v3.0
1.96k stars 123 forks source link

NFO/jpg not saving to same folder as content/metadata. #294

Open NeuralMiner opened 1 year ago

NeuralMiner commented 1 year ago

Hello. Odd issue. When I set the media format to nest the files inside of a folder (I use the year), it doesn't place the extra nfo and jpg files in the same folder as the video and metadata files; it places them in the root folder. The media format I'm using: Season {yyyy}/{title} {mm}{dd} [{key}].{ext}

Screenshot of directories: image

image

meeb commented 1 year ago

Saving media itself into subdirectories was never fully tested really so this isn't too surprising a bug. Thanks for reporting it, should be reasonably easy to fix.

mogorman commented 1 year ago

https://github.com/meeb/tubesync/blob/e871983707ae202bbd6c1eb4b96f0b91da5923f1/tubesync/sync/models.py#L1094

seems like if we always preferred the else it would work no?

meeb commented 1 year ago

No, when the media item is not downloaded the filename is effectively the "future filename" created from parameters set in the source (such as desired resolution etc.). This changes if the source is updated. Always using self.filename would cause the reference to the filename that's actually downloaded (and therefore a fixed name of a file on disk once downloaded) to break.