aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorksooo <3226626+ksooo@users.noreply.github.com>2024-06-26 23:14:39 +0200
committerksooo <3226626+ksooo@users.noreply.github.com>2024-07-10 09:06:30 +0200
commitc9e8e455e9bbe47ccee84f5fc34d922d1139688a (patch)
tree766a75e67418fb49e81f6fe9027a52404708459b
parent6186114acf4354697317b64d4a75f72eebf353dc (diff)
[video] GUIDialogVideoBookmarks: Use correct item path to write and read bookmarks.
-rw-r--r--xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp20
1 files changed, 4 insertions, 16 deletions
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();