Compare commits

..

2 Commits

Author SHA1 Message Date
98eb833dc0 Cleanup movies handling
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Do not delete fields about a movie when we already have them
Movie has no UserID field
2020-04-06 18:20:28 +02:00
72970bd52e Cleanup episodes handling
Do not delete fields about an episode when we already have them
Update the polochon and trakttv libs
2020-04-06 18:20:14 +02:00

View File

@ -68,18 +68,10 @@ func NewEpisodeFromDB(eDB *episodeDB) *polochon.ShowEpisode {
// FillEpisodeFromDB fills a ShowEpisode from an episodeDB // FillEpisodeFromDB fills a ShowEpisode from an episodeDB
func FillEpisodeFromDB(eDB *episodeDB, pEpisode *polochon.ShowEpisode) { func FillEpisodeFromDB(eDB *episodeDB, pEpisode *polochon.ShowEpisode) {
// Keep the data that never changes but only if we have it // Keep the data that never changes but only if we have it
if eDB.TvdbID != 0 { updateIfNonEmpty(&pEpisode.EpisodeImdbID, eDB.ImdbID)
pEpisode.TvdbID = eDB.TvdbID updateIfNonEmpty(&pEpisode.ShowImdbID, eDB.ShowImdbID)
} updateIfNonZeroInt(&pEpisode.TvdbID, eDB.TvdbID)
if eDB.ImdbID != "" { updateIfNonZeroInt(&pEpisode.ShowTvdbID, eDB.ShowTvdbID)
pEpisode.EpisodeImdbID = eDB.ImdbID
}
if eDB.ShowImdbID != "" {
pEpisode.ShowImdbID = eDB.ShowImdbID
}
if eDB.ShowTvdbID != 0 {
pEpisode.ShowTvdbID = eDB.ShowTvdbID
}
pEpisode.Season = eDB.Season pEpisode.Season = eDB.Season
pEpisode.Episode = eDB.Episode pEpisode.Episode = eDB.Episode
pEpisode.Title = eDB.Title pEpisode.Title = eDB.Title