diff options
author | Kai Sommerfeld <3226626+ksooo@users.noreply.github.com> | 2023-12-29 19:10:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-29 19:10:31 +0100 |
commit | f89e88abdfc85559789a6c383a707806dc525712 (patch) | |
tree | 61d130a45cfdf5f5e3557d3b7b3cb245ed14c39a | |
parent | 4532c7441510a9c9ebfa2023dd129ce13544890b (diff) | |
parent | ec8a7c80d8b4dbe634af07c1f7f3f30f8aaf2f6b (diff) |
Merge pull request #24356 from ksooo/video-versions-extras-stuff
[video] Video Versions/Extras: More smaller cleanup and fixes
-rw-r--r-- | addons/resource.language.en_gb/resources/strings.po | 6 | ||||
-rw-r--r-- | xbmc/video/VideoDatabase.cpp | 33 | ||||
-rw-r--r-- | xbmc/video/dialogs/GUIDialogVideoInfo.cpp | 6 |
3 files changed, 24 insertions, 21 deletions
diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po index 3d6dc7e757..735acb5773 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po @@ -23754,7 +23754,7 @@ msgstr "" #. Manage video version dialog title #: xbmc/video/dialogs/GUIDialogVideoManagerVersions.cpp msgctxt "#40002" -msgid "Convert into an additional version" +msgid "Add as version to..." msgstr "" #empty string with id 40003 @@ -23867,10 +23867,10 @@ msgctxt "#40020" msgid "Are you sure to remove version \"{0:s}\"?" msgstr "" -#. Convert video to version context menu item +#. Add as version to a movie context menu item #: xbmc/video/dialogs/GUIDialogVideoInfo.cpp msgctxt "#40021" -msgid "Convert to version" +msgid "Add as version to..." msgstr "" #. Manage video version dialog title diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index 4c6dfb560c..8dc2ae15be 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -1274,7 +1274,8 @@ int CVideoDatabase::GetMovieId(const std::string& strFilenameAndPath) if (idFile == -1) strSQL=PrepareSQL("select idMovie from movie join files on files.idFile=movie.idFile where files.idPath=%i",idPath); else - strSQL = PrepareSQL("select idMedia from videoversion where idFile = %i", idFile); + strSQL = PrepareSQL("SELECT idMedia FROM videoversion WHERE idFile = %i AND itemType = %i", + idFile, VideoAssetType::VERSION); CLog::Log(LOGDEBUG, LOGDATABASE, "{} ({}), query = {}", __FUNCTION__, CURL::GetRedacted(strFilenameAndPath), strSQL); @@ -12340,21 +12341,23 @@ bool CVideoDatabase::GetVideoVersionsNav(const std::string& strBaseDir, std::string strSQL; if (idMedia != -1) - strSQL = PrepareSQL("SELECT videoversiontype.name AS name," - " videoversiontype.id AS id " - "FROM videoversiontype" - " JOIN videoversion ON" - " videoversion.idType = videoversiontype.id " - "WHERE idMedia = %i AND mediaType = '%s'", - idMedia, mediaType.c_str()); + strSQL = + PrepareSQL("SELECT videoversiontype.name AS name," + " videoversiontype.id AS id " + "FROM videoversiontype" + " JOIN videoversion ON" + " videoversion.idType = videoversiontype.id " + "WHERE idMedia = %i AND mediaType = '%s' AND videoversiontype.itemType = %i", + idMedia, mediaType.c_str(), VideoAssetType::VERSION); else - strSQL = PrepareSQL("SELECT DISTINCT videoversiontype.name AS name," - " videoversiontype.id AS id " - "FROM videoversiontype" - " JOIN videoversion ON" - " videoversion.idType = videoversiontype.id " - "WHERE name != '' AND owner IN (%i, %i)", - VideoAssetTypeOwner::SYSTEM, VideoAssetTypeOwner::USER); + strSQL = PrepareSQL( + "SELECT DISTINCT videoversiontype.name AS name," + " videoversiontype.id AS id " + "FROM videoversiontype" + " JOIN videoversion ON" + " videoversion.idType = videoversiontype.id " + "WHERE name != '' AND owner IN (%i, %i) AND videoversiontype.itemType = %i", + VideoAssetTypeOwner::SYSTEM, VideoAssetTypeOwner::USER, VideoAssetType::VERSION); m_pDS->query(strSQL); diff --git a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp index c3e8d63c5c..65746b0d8a 100644 --- a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp +++ b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp @@ -1075,11 +1075,11 @@ int CGUIDialogVideoInfo::ManageVideoItem(const std::shared_ptr<CFileItem>& item) // set or change movie set the movie belongs to buttons.Add(CONTEXT_BUTTON_SET_MOVIESET, 20465); - if (!item->GetVideoInfoTag()->HasVideoVersions()) - buttons.Add(CONTEXT_BUTTON_CONVERT_VIDEOVERSION, 40021); // Convert to version - // manage video versions buttons.Add(CONTEXT_BUTTON_MANAGE_VIDEOVERSION, 40001); // Manage versions + + if (!item->GetVideoInfoTag()->HasVideoVersions()) + buttons.Add(CONTEXT_BUTTON_CONVERT_VIDEOVERSION, 40021); // Add as version to... } if (type == MediaTypeEpisode && |