r/pythonhelp • u/Xx255q • May 27 '23
Script not skipping scanning for volumes that have already been scanned less than one week ago
In order to reduce the amount of api calls my script does I wanted to setup a number of things like only scan for ongoing series or new series added to the comicvine website. then i created other checks like if a series has not had a new issue in 13 months mark as complete and finally if a series has already been scanned in the last seven days skip it. Issue is like my title says its still scanning for them and updating data that does not need to be updated. I know there are other issues with my script such as fields setup in the database which are not called for and lack of logging when I see under last modified for the db files it keeps updating but i dont have logs as to what its doing. I am sure there are other issues others but I am pretty new to python and need to focus on one issue at a time. here is my current script:
1
u/CraigAT May 27 '23 edited May 27 '23
When you look at the database, how many last scan dates are within a week? (Is the saved data correct?) - Just seen you are not using individual dates, instead using the entry in last_update_table.
If you run the query that gets the last scan dates, do you get what you expect? (Test the query)
If you run the api call with the parameters you are specifying do you get the result you expect (the API may not give the results you expect)