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

Re-enable manually add to library #1021

Closed
Closed
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
7 changes: 7 additions & 0 deletions xbmc/video/windows/GUIWindowVideoBase.cpp
Expand Up @@ -1827,6 +1827,13 @@ void CGUIWindowVideoBase::AddToDatabase(int iItem)
m_database.Open();
int idMovie = m_database.AddMovie(pItem->GetPath());
movie.m_strIMDBNumber.Format("xx%08i", idMovie);

if (movie.m_basePath.IsEmpty())
movie.m_basePath = pItem->GetBaseMoviePath(false);
movie.m_parentPathID = m_database.AddPath(URIUtils::GetParentPath(movie.m_basePath));

movie.m_strFileNameAndPath = pItem->GetPath();

m_database.SetDetailsForMovie(pItem->GetPath(), movie, pItem->GetArt());
m_database.Close();

Expand Down
13 changes: 13 additions & 0 deletions xbmc/video/windows/GUIWindowVideoNav.cpp
Expand Up @@ -1030,6 +1030,13 @@ void CGUIWindowVideoNav::GetContextButtons(int itemNumber, CContextButtons &butt
buttons.Add(CONTEXT_BUTTON_DELETE, 117);
buttons.Add(CONTEXT_BUTTON_RENAME, 118);
}

if (!item->IsLiveTV())
{
if (!m_database.HasMovieInfo(item->GetPath()) && !m_database.HasEpisodeInfo(item->GetPath()))
buttons.Add(CONTEXT_BUTTON_ADD_TO_LIBRARY, 527); // Add to Database
}

// add "Set/Change content" to folders
if (item->m_bIsFolder && !item->IsPlayList() && !item->IsSmartPlayList() && !item->IsLiveTV() && !item->IsPlugin() && !item->IsAddonsPath())
{
Expand Down Expand Up @@ -1330,6 +1337,12 @@ bool CGUIWindowVideoNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
return true;
}

case CONTEXT_BUTTON_ADD_TO_LIBRARY:
{
AddToDatabase(itemNumber);
return true;
}

default:
break;

Expand Down