aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <3226626+ksooo@users.noreply.github.com>2024-07-10 12:35:10 +0200
committerGitHub <noreply@github.com>2024-07-10 12:35:10 +0200
commit7e5bb325bda3f121709578cf61f6fdfcd665260b (patch)
treeb54de706b9fa17ba00417f197237baf34b77af85
parent72c9107cce9d1d7145dd4af245bf4f7f23af2e99 (diff)
parent96b895852524f70c966444e615fd0bff4132adbe (diff)
Merge pull request #25470 from ksooo/video-fix-bookmarks-db-persistence-omega
[Omega] [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 fcbacd8bfe..5623e9a7e1 100644
--- a/xbmc/FileItem.cpp
+++ b/xbmc/FileItem.cpp
@@ -3797,12 +3797,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)
@@ -3815,7 +3815,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 425344219e..c98cfe1c16 100644
--- a/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp
+++ b/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp
@@ -185,10 +185,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();
@@ -202,10 +199,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();
@@ -351,10 +345,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);
@@ -425,10 +416,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();