aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCrystalP <crystalp@kodi.tv>2023-12-30 20:44:45 -0500
committerCrystalP <crystalp@kodi.tv>2023-12-30 22:14:18 -0500
commit8b53e54e5e8cb12d7a3dad4c7db344ed94014170 (patch)
tree5522d29435d2d9a271277316fe1730fc9838bdfb
parentf8b8a69fcba4e859e72067972b609432c38bd0d0 (diff)
[VideoDB] Remove unused user-defined movie version types
Address gap in migration of db to v127 PR#24340
-rw-r--r--xbmc/video/VideoDatabase.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp
index a5e65a2613..5947455dc8 100644
--- a/xbmc/video/VideoDatabase.cpp
+++ b/xbmc/video/VideoDatabase.cpp
@@ -6238,6 +6238,18 @@ void CVideoDatabase::UpdateTables(int iVersion)
if (iVersion < 128)
{
m_pDS2->exec("ALTER TABLE videoversion RENAME COLUMN mediaType TO media_type");
+
+ // Fix gap in the migration to videodb v127 for unused user-defined video version types.
+ // Unfortunately due to original design we cannot tell which ones were movie versions or
+ // extras and now they're all displayed in the version type selection for movies.
+ // Remove them all as the better fix of providing a GUI to manage version types will not be
+ // available in Omega v21. That implies the loss of the unused user-defined version names
+ // created since v21 beta 2.
+ m_pDS2->exec(PrepareSQL("DELETE FROM videoversiontype "
+ "WHERE id NOT IN (SELECT idType FROM videoversion) "
+ "AND owner = %i "
+ "AND itemType = %i",
+ VideoAssetTypeOwner::USER, VideoAssetType::VERSION));
}
}