Best way set and check last file downloaded?

  • Thread starter Thread starter syarbrou
  • Start date Start date
S

syarbrou

Guest
I have a program I wrote that downloads shows. it goes out and grabs some JSON that returns the last 18 days of shows. So I am already checking if the folder contains the file and skips it and moves onto the next one, but people could be watching these shows and deleting them so right now the downloader will redownload those files if they are in the 18 day range it checks back to. Make sense?


So I was thinking I either need a log file that contains a list of everything it's ever downloaded. That log would have to be constantly read in to check if it's in there and written to when the file has completed downloading then loop again.


Or a log file that shows like the season and episode last downloaded that is read in and compared to each file it's about to download. So say the last download was Season 34 and Episode 20 would save in a log like 3420. Then would only download anything where combining the season and episode were more than what was in the log or maybe could be stored in the config. Only trick to this is the JSON doesn't always download in the right order and is usually newest to oldest so the last file it processes in a batch could be the oldest file not the newest.


Any thoughts on above or alternatives?

Continue reading...
 
Back
Top