ben-xo / dir2cast

Turn a directory of MP3s into a podcast - automatically.
http://www.ben-xo.com/dir2cast
BSD 3-Clause "New" or "Revised" License
152 stars 20 forks source link

Suggestion: clear cache when count of mp3 files in directory != count in feed #39

Closed wesyah234 closed 4 years ago

wesyah234 commented 4 years ago

I was uploading mp3 files with older timestamps, and the cache was not clearing. I 'touched' the mp3 file and this caused the cache to clear. Perhaps you could count the files in the feed and compare to the files in the directory and if not equal, just clear the cache. Thanks!

ben-xo commented 4 years ago

This can definitely be done and shouldn't impact my use case to do, but may I ask how you're uploading files with old timestamps / what your use case is here?

wesyah234 commented 4 years ago

Sure. If you have some of your own mp3 files with old timestamps and you want to upload them to your personal feed, it will work one time, but once the cache is established, you can't upload any new mp3s. I find podcast feeds are very handy for getting personal music files onto various devices (apple and android, tablets and phones), without having to deal with itunes on apple or various syncing options for getting music into android devices.

ben-xo commented 4 years ago

Right, so you've dropped dir2cast into a folder of stuff you already had, rather than uploading mp3s ('episode by episode') to a folder where you're publishing a podcast?

What OS? Linux?

I'm not sure if I want to track the file count anywhere as that's a new piece of information to keep track of. It's all based on the 'mtime' of episode files at the moment - most people are using this to detect when a new podcast episode has been uploaded to a remote server.

you can, of course, use scp or rsync without having it preserve timestamps.

wesyah234 commented 4 years ago

Yes, I can change my processes as needed to get the timestamp detection to work properly, no need to change anything major. Thank you!