Permalink
Browse files

Use m_type of the videoinfotag if available in the announcemanager, a…

…nd remove the hack in VideoInfoScanner as no longer required
  • Loading branch information...
1 parent 7af1180 commit 3f61c86d3a670462f4ed8b71486a2b67168acb21 Jonathan Marshall committed Oct 11, 2012
Showing with 8 additions and 5 deletions.
  1. +4 −1 xbmc/interfaces/AnnouncementManager.cpp
  2. +4 −4 xbmc/video/VideoInfoScanner.cpp
@@ -113,7 +113,10 @@ void CAnnouncementManager::Announce(AnnouncementFlag flag, const char *sender, c
}
}
- CVideoDatabase::VideoContentTypeToString((VIDEODB_CONTENT_TYPE)item->GetVideoContentType(), type);
+ if (!item->GetVideoInfoTag()->m_type.empty())
+ type = item->GetVideoInfoTag()->m_type;
+ else
+ CVideoDatabase::VideoContentTypeToString((VIDEODB_CONTENT_TYPE)item->GetVideoContentType(), type);
if (id <= 0)
{
@@ -1080,6 +1080,7 @@ namespace VIDEO
lResult = m_database.SetDetailsForMovie(pItem->GetPath(), movieDetails, art);
movieDetails.m_iDbId = lResult;
+ movieDetails.m_type = "movie";
// setup links to shows if the linked shows are in the db
for (unsigned int i=0; i < movieDetails.m_showLink.size(); ++i)
@@ -1101,6 +1102,7 @@ namespace VIDEO
GetSeasonThumbs(movieDetails, seasonArt);
lResult = m_database.SetDetailsForTvShow(pItem->GetPath(), movieDetails, art, seasonArt);
movieDetails.m_iDbId = lResult;
+ movieDetails.m_type = "tvshow";
}
else
{
@@ -1110,6 +1112,7 @@ namespace VIDEO
int idEpisode = m_database.AddEpisode(idShow, pItem->GetPath());
lResult = m_database.SetDetailsForEpisode(pItem->GetPath(), movieDetails, art, idShow, idEpisode);
movieDetails.m_iDbId = lResult;
+ movieDetails.m_type = "episode";
if (movieDetails.m_fEpBookmark > 0)
{
movieDetails.m_strFileNameAndPath = pItem->GetPath();
@@ -1125,6 +1128,7 @@ namespace VIDEO
{
lResult = m_database.SetDetailsForMusicVideo(pItem->GetPath(), movieDetails, art);
movieDetails.m_iDbId = lResult;
+ movieDetails.m_type = "musicvideo";
}
if (g_advancedSettings.m_bVideoLibraryImportWatchedState || libraryImport)
@@ -1137,10 +1141,6 @@ namespace VIDEO
m_database.Close();
CFileItemPtr itemCopy = CFileItemPtr(new CFileItem(*pItem));
- // Hack to make sure CVideoInfoTag::m_strShowTitle is set for tvshows
- // to make sure CAnnouncementManager provides the correct type for the item
- if (content == CONTENT_TVSHOWS && !pItem->m_bIsFolder && itemCopy->HasVideoInfoTag())
- itemCopy->GetVideoInfoTag()->m_strShowTitle = itemCopy->GetVideoInfoTag()->m_strTitle;
ANNOUNCEMENT::CAnnouncementManager::Announce(ANNOUNCEMENT::VideoLibrary, "xbmc", "OnUpdate", itemCopy);
return lResult;
}

0 comments on commit 3f61c86

Please sign in to comment.