Permalink
Browse files

[videodb] add genre to episode_view

  • Loading branch information...
mkortstiege committed Aug 30, 2015
1 parent c336ec1 commit bda4e824124621b6bfda866d1ae97e7f5d5cf720
Showing with 14 additions and 8 deletions.
  1. +7 −2 xbmc/video/VideoDatabase.cpp
  2. +7 −6 xbmc/video/VideoDatabase.h
@@ -343,6 +343,7 @@ void CVideoDatabase::CreateViews()
" files.lastPlayed AS lastPlayed,"
" files.dateAdded AS dateAdded,"
" tvshow.c%02d AS strTitle,"
" tvshow.c%02d AS genre,"
" tvshow.c%02d AS studio,"
" tvshow.c%02d AS premiered,"
" tvshow.c%02d AS mpaa,"
@@ -359,7 +360,10 @@ void CVideoDatabase::CreateViews()
" JOIN path ON"
" files.idPath=path.idPath"
" LEFT JOIN bookmark ON"
" bookmark.idFile=episode.idFile AND bookmark.type=1", VIDEODB_ID_TV_TITLE, VIDEODB_ID_TV_STUDIOS, VIDEODB_ID_TV_PREMIERED, VIDEODB_ID_TV_MPAA,VIDEODB_ID_EPISODE_SEASON);
" bookmark.idFile=episode.idFile AND bookmark.type=1",
VIDEODB_ID_TV_TITLE, VIDEODB_ID_TV_GENRE,
VIDEODB_ID_TV_STUDIOS, VIDEODB_ID_TV_PREMIERED,
VIDEODB_ID_TV_MPAA, VIDEODB_ID_EPISODE_SEASON);
m_pDS->exec(episodeview.c_str());

CLog::Log(LOGINFO, "create tvshowcounts");
@@ -3577,6 +3581,7 @@ CVideoInfoTag CVideoDatabase::GetDetailsForEpisode(const dbiplus::sql_record* co
details.m_dateAdded.SetFromDBDateTime(record->at(VIDEODB_DETAILS_EPISODE_DATEADDED).get_asString());
details.m_strMPAARating = record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_MPAA).get_asString();
details.m_strShowTitle = record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_NAME).get_asString();
details.m_genre = StringUtils::Split(record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_GENRE).get_asString(), g_advancedSettings.m_videoItemSeparator);
details.m_studio = StringUtils::Split(record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_STUDIO).get_asString(), g_advancedSettings.m_videoItemSeparator);
details.m_premiered.SetFromDBDate(record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_AIRED).get_asString());
details.m_iIdShow = record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_ID).get_asInt();
@@ -4570,7 +4575,7 @@ void CVideoDatabase::UpdateTables(int iVersion)

int CVideoDatabase::GetSchemaVersion() const
{
return 94;
return 95;
}

bool CVideoDatabase::LookupByFolders(const std::string &path, bool shows)
@@ -87,12 +87,13 @@ namespace VIDEO
#define VIDEODB_DETAILS_EPISODE_LASTPLAYED VIDEODB_MAX_COLUMNS + 6
#define VIDEODB_DETAILS_EPISODE_DATEADDED VIDEODB_MAX_COLUMNS + 7
#define VIDEODB_DETAILS_EPISODE_TVSHOW_NAME VIDEODB_MAX_COLUMNS + 8
#define VIDEODB_DETAILS_EPISODE_TVSHOW_STUDIO VIDEODB_MAX_COLUMNS + 9
#define VIDEODB_DETAILS_EPISODE_TVSHOW_AIRED VIDEODB_MAX_COLUMNS + 10
#define VIDEODB_DETAILS_EPISODE_TVSHOW_MPAA VIDEODB_MAX_COLUMNS + 11
#define VIDEODB_DETAILS_EPISODE_RESUME_TIME VIDEODB_MAX_COLUMNS + 12
#define VIDEODB_DETAILS_EPISODE_TOTAL_TIME VIDEODB_MAX_COLUMNS + 13
#define VIDEODB_DETAILS_EPISODE_SEASON_ID VIDEODB_MAX_COLUMNS + 14
#define VIDEODB_DETAILS_EPISODE_TVSHOW_GENRE VIDEODB_MAX_COLUMNS + 9
#define VIDEODB_DETAILS_EPISODE_TVSHOW_STUDIO VIDEODB_MAX_COLUMNS + 10
#define VIDEODB_DETAILS_EPISODE_TVSHOW_AIRED VIDEODB_MAX_COLUMNS + 11
#define VIDEODB_DETAILS_EPISODE_TVSHOW_MPAA VIDEODB_MAX_COLUMNS + 12
#define VIDEODB_DETAILS_EPISODE_RESUME_TIME VIDEODB_MAX_COLUMNS + 13
#define VIDEODB_DETAILS_EPISODE_TOTAL_TIME VIDEODB_MAX_COLUMNS + 14
#define VIDEODB_DETAILS_EPISODE_SEASON_ID VIDEODB_MAX_COLUMNS + 15

#define VIDEODB_DETAILS_TVSHOW_PARENTPATHID VIDEODB_MAX_COLUMNS + 1
#define VIDEODB_DETAILS_TVSHOW_PATH VIDEODB_MAX_COLUMNS + 2

0 comments on commit bda4e82

Please sign in to comment.