Closed thereido closed 2 years ago
The issue38.php script has been tested. It covers movies, tv shows, and tv episodes. Each type (movie/show/episode) is handled in a different way.
Movies:
TV Shows:
TV Episodes:
Fixed the db in BW prod today with version commit https://github.com/thereido/RatingSync/commit/fd261f83fdc92aa12a251af4fc9f6268cbe24cf0
This only fixes existing db problems. It does not stop it from happening again. A full code fix is needed... maybe. Reevaluate it after issue #37 is fixed.
Issue #38 is fixed. I don't think it affects this issue. However, the current code does not seem to be cause this issue anymore. I don't think it's worth debugging it unless it comes up again.
That means separate titles are using the same "unique" TMDb ID.
SELECT COUNT(film_id), film_source.* FROM film_source WHERE source_name='TMDb' GROUP BY uniqueName HAVING COUNT(film_id) > 1;
-- Step 1 all dups - Get the 2nd film_id SELECT FROM film_source WHERE source_name='TMDb' AND uniqueName='ep1136939' -- Step 2 Get TV Series uniqueName, Season and Episode number SELECT f.id, f.parent_id, f.title, f.season, f.episodeNumber, f.episodeTitle, parentfs.uniqueName parent_un FROM film f, film_source parentfs WHERE f.id=1902 AND f.parent_id=parentfs.film_id AND parentfs.source_name='TMDb'; -- Step 3 Get the correct episode uniqueName https://api.themoviedb.org/3/tv/62823/season/1/episode/1?api_key=b34fb5c8c7ad394135edc8236bbb7b05&language=en-US -- Step 4 Update the correct uniqueName UPDATE film_source SET uniqueName='ep1068354' WHERE film_id=1902 AND source_name='TMDb' AND uniqueName='ep1136939'; -- Step 5 Are there extra film rows for the tv series? SELECT FROM film WHERE title='Glitch' ORDER BY season, episodeNumber