chenqingyu / auto-sub

Automatically exported from code.google.com/p/auto-sub
0 stars 0 forks source link

Add support for Episode database to prevent multiple downloads #60

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
With the new database and API limiter:
If a new subtitle is spotted on bierdopje but could not be downloaded because 
it did the max API calls. Lets say scanDisk runs again, it will added to not 
download subtitle to the wanted queue again. So it will download subtitle more 
then one time. This can even result in a loop, if there are more items being 
add then items that can be downloaded in 1 hour.

- Scandisk adds Dexter to wanted queue
- Checksub finds subtitle for dexter adds it to download queue, removes it from 
wanted queue
- Download subs, can not download now. Have to wait 1 hour for a API call reset
- Scandisk sees dexter without a subtitle file
- Checksub find a subtitle for dexter
- Download sub, we can download now! Downloads 2 dexter subtitles.

How would we prevent this?
Add a new table to the database, called 'Episode DB'. In this database info is 
stored for each episode.
Database schema would be:
| episodeid | localshowid | status | downloadedsub | localvideofile | 
localsrtfile | airdate | 

Status can be:
 - 0 - downloaded (subdownload)
 - 1 - wanted (no subtitle there yet)
 - 2 - snatched (a sub is available, added to downloadqueue)
 - 3 - skipped (not going to download this one)

ScanDisk need a couple of changes. It needs a new function called:
Build EpisodeDB(path,bierdopje_id):
scan path, sees video files.
Check if video file is same bierdopje_id
If so, check status.
If srt -> status is downloaded
if no-srt -> status is wanted

Original issue reported on code.google.com by romke.va...@gmail.com on 4 Mar 2012 at 11:46

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 527c7adc9886.

Original comment by romke.va...@gmail.com on 4 Mar 2012 at 7:13