Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fix duplicate shows and fix orphan episodes in MainSanityCheck #451

Merged
merged 1 commit into from Aug 27, 2012
Merged

Conversation

ghost
Copy link

@ghost ghost commented Aug 8, 2012

Added two more sanity checks for the sickbeard.db

Duplicate Shows: Shows with the same tvdb_id
Remove all but one.

Orphan episodes: Episodes with no tvdb_id parent in tv_shows
Remove all

@midgetspy
Copy link
Owner

Are these scenarios that you've encountered? If so I'd like to try to reproduce them as well.

@ghost
Copy link
Author

ghost commented Aug 18, 2012

I have only seen the MultipleDBShowsException in the forum,
and didn't like resorting to external tools there:

http://sickbeard.com/forums/viewtopic.php?f=4&t=4789
http://sickbeard.com/forums/viewtopic.php?f=4&t=4715

The only way I got multipleDBShows in my test database, when I used SQL to put it there.

The Orphan episodes I found on my own (test) system too.
Don't know how long they have been there, so don't know what made them stay.
Orphan epsiodes normally isn't a big deal, only when you check total downloads.
I found them trying to figure out why the total download count was not correct in this question http://sickbeard.com/forums/viewtopic.php?f=4&t=4774 (was another problem though)
This person http://sickbeard.com/forums/viewtopic.php?f=4&t=4771 jumped in and had orphans also.

@thezoggy
Copy link
Contributor

prob an issue when the ep get deleted from tvdb but we didnt delete them on our end. ive had this happened with topgear when they shuffle episodes around in specials..

@ghost
Copy link
Author

ghost commented Aug 20, 2012

For the orphans, the only thing I could think off:

    myDB.action("DELETE FROM tv_episodes WHERE showid = ?", [self.tvdbid])
    myDB.action("DELETE FROM tv_shows WHERE tvdb_id = ?", [self.tvdbid])

The second delete doesn't check if the first one succeeds.
But I guess it only fails if the first delete was against a locked database and therefore didn't delete the episodes
and the database was unlocked just before/ during the second delete.

midgetspy added a commit that referenced this pull request Aug 27, 2012
Add fix duplicate shows and fix orphan episodes in MainSanityCheck
@midgetspy midgetspy merged commit 88158ee into midgetspy:development Aug 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants