aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <3226626+ksooo@users.noreply.github.com>2024-06-28 12:38:39 +0200
committerGitHub <noreply@github.com>2024-06-28 12:38:39 +0200
commitc23991299e4e7e5ad32967646d402b30c74d0c6e (patch)
tree9ebb4e1bd559a9f1f3a552c3a998edde588ac628
parentf517e31cef8206c91dce6970bd551b99e421b78a (diff)
parent66dc6399f08ef0487a7bf59811e3433b09eb87af (diff)
Merge pull request #25394 from ksooo/video-fix-bookmarks-db-persistence
[video| Fix bookmarks db persistence
-rw-r--r--xbmc/FileItem.cpp8
-rw-r--r--xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp20
2 files changed, 8 insertions, 20 deletions
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp
index 43ca4749ed..98360446a3 100644
--- a/xbmc/FileItem.cpp
+++ b/xbmc/FileItem.cpp
@@ -2430,12 +2430,12 @@ bool CFileItem::LoadDetails()
bool ret{false};
auto tag{std::make_unique<CVideoInfoTag>()};
if (params.GetMovieId() >= 0)
- ret = db.GetMovieInfo(GetPath(), *tag, static_cast<int>(params.GetMovieId()),
+ ret = db.GetMovieInfo({}, *tag, static_cast<int>(params.GetMovieId()),
static_cast<int>(params.GetVideoVersionId()));
else if (params.GetMVideoId() >= 0)
- ret = db.GetMusicVideoInfo(GetPath(), *tag, static_cast<int>(params.GetMVideoId()));
+ ret = db.GetMusicVideoInfo({}, *tag, static_cast<int>(params.GetMVideoId()));
else if (params.GetEpisodeId() >= 0)
- ret = db.GetEpisodeInfo(GetPath(), *tag, static_cast<int>(params.GetEpisodeId()));
+ ret = db.GetEpisodeInfo({}, *tag, static_cast<int>(params.GetEpisodeId()));
else if (params.GetSetId() >= 0) // movie set
ret = db.GetSetInfo(static_cast<int>(params.GetSetId()), *tag, this);
else if (params.GetTvShowId() >= 0)
@@ -2448,7 +2448,7 @@ bool CFileItem::LoadDetails()
ret = db.GetSeasonInfo(idSeason, *tag, this);
}
else
- ret = db.GetTvShowInfo(GetPath(), *tag, static_cast<int>(params.GetTvShowId()), this);
+ ret = db.GetTvShowInfo({}, *tag, static_cast<int>(params.GetTvShowId()), this);
}
if (ret)
diff --git a/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp b/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp
index 344b0b5a07..f97c8c1d21 100644
--- a/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp
@@ -188,10 +188,7 @@ void CGUIDialogVideoBookmarks::Delete(int item)
{
CVideoDatabase videoDatabase;
videoDatabase.Open();
- std::string path(g_application.CurrentFile());
- if (g_application.CurrentFileItem().HasProperty("original_listitem_url") &&
- !URIUtils::IsVideoDb(g_application.CurrentFileItem().GetProperty("original_listitem_url").asString()))
- path = g_application.CurrentFileItem().GetProperty("original_listitem_url").asString();
+ const std::string path{g_application.CurrentFileItem().GetDynPath()};
videoDatabase.ClearBookMarkOfFile(path, m_bookmarks[item], m_bookmarks[item].type);
videoDatabase.Close();
CUtil::DeleteVideoDatabaseDirectoryCache();
@@ -205,10 +202,7 @@ void CGUIDialogVideoBookmarks::OnRefreshList()
std::vector<CFileItemPtr> items;
// open the d/b and retrieve the bookmarks for the current movie
- m_filePath = g_application.CurrentFile();
- if (g_application.CurrentFileItem().HasProperty("original_listitem_url") &&
- !URIUtils::IsVideoDb(g_application.CurrentFileItem().GetProperty("original_listitem_url").asString()))
- m_filePath = g_application.CurrentFileItem().GetProperty("original_listitem_url").asString();
+ m_filePath = g_application.CurrentFileItem().GetDynPath();
CVideoDatabase videoDatabase;
videoDatabase.Open();
@@ -355,10 +349,7 @@ void CGUIDialogVideoBookmarks::ClearBookmarks()
{
CVideoDatabase videoDatabase;
videoDatabase.Open();
- std::string path = g_application.CurrentFile();
- if (g_application.CurrentFileItem().HasProperty("original_listitem_url") &&
- !URIUtils::IsVideoDb(g_application.CurrentFileItem().GetProperty("original_listitem_url").asString()))
- path = g_application.CurrentFileItem().GetProperty("original_listitem_url").asString();
+ const std::string path{g_application.CurrentFileItem().GetDynPath()};
videoDatabase.ClearBookMarksOfFile(path, CBookmark::STANDARD);
videoDatabase.ClearBookMarksOfFile(path, CBookmark::RESUME);
videoDatabase.ClearBookMarksOfFile(path, CBookmark::EPISODE);
@@ -471,10 +462,7 @@ bool CGUIDialogVideoBookmarks::AddBookmark(CVideoInfoTag* tag)
videoDatabase.AddBookMarkForEpisode(*tag, bookmark);
else
{
- std::string path = g_application.CurrentFile();
- if (g_application.CurrentFileItem().HasProperty("original_listitem_url") &&
- !URIUtils::IsVideoDb(g_application.CurrentFileItem().GetProperty("original_listitem_url").asString()))
- path = g_application.CurrentFileItem().GetProperty("original_listitem_url").asString();
+ const std::string path{g_application.CurrentFileItem().GetDynPath()};
videoDatabase.AddBookMarkToFile(path, bookmark, CBookmark::STANDARD);
}
videoDatabase.Close();