Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[video] Only allow delete from library if user has DB write permission #6570

Merged
merged 1 commit into from Mar 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions language/English/strings.po
Expand Up @@ -1090,6 +1090,7 @@ msgid "Fetching CD information"
msgstr ""

#: xbmc/dialogs/GUIDialogFileBrowser.cpp
#: xbmc/video/windows/GUIWindowVideoNav.cpp
msgctxt "#257"
msgid "Error"
msgstr ""
Expand Down Expand Up @@ -2806,6 +2807,7 @@ msgctxt "#661"
msgid "Choose export folder"
msgstr ""

#: xbmc/video/windows/GUIWindowVideoNav.cpp
msgctxt "#662"
msgid "This file is no longer available."
msgstr ""
Expand Down
20 changes: 14 additions & 6 deletions xbmc/video/windows/GUIWindowVideoNav.cpp
Expand Up @@ -1046,13 +1046,21 @@ bool CGUIWindowVideoNav::OnClick(int iItem)
if (!item->m_bIsFolder && item->IsVideoDb() && !item->Exists())
{
CLog::Log(LOGDEBUG, "%s called on '%s' but file doesn't exist", __FUNCTION__, item->GetPath().c_str());
if (!CGUIDialogVideoInfo::DeleteVideoItemFromDatabase(item, true))
return true;
if (CProfilesManager::Get().GetCurrentProfile().canWriteDatabases())
{
if (!CGUIDialogVideoInfo::DeleteVideoItemFromDatabase(item, true))
return true;

// update list
Refresh(true);
m_viewControl.SetSelectedItem(iItem);
return true;
// update list
Refresh(true);
m_viewControl.SetSelectedItem(iItem);
return true;
}
else
{
CGUIDialogOK::ShowAndGetInput(257, 0, 662, 0);
return true;
}
}
else if (StringUtils::StartsWithNoCase(item->GetPath(), "newtag://"))
{
Expand Down