Permalink
Browse files

re enable manually add to library

  • Loading branch information...
Voyager1 committed Oct 22, 2012
1 parent ae60d24 commit b507f10d44843cac48e81640c4b241c860dc479e
Showing with 20 additions and 0 deletions.
  1. +7 −0 xbmc/video/windows/GUIWindowVideoBase.cpp
  2. +13 −0 xbmc/video/windows/GUIWindowVideoNav.cpp
@@ -1958,6 +1958,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();
@@ -1042,6 +1042,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() && !URIUtils::IsUPnP(item->GetPath()))
{
@@ -1372,6 +1379,12 @@ bool CGUIWindowVideoNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button)
return true;
}
+ case CONTEXT_BUTTON_ADD_TO_LIBRARY:
+ {
+ AddToDatabase(itemNumber);
+ return true;
+ }
+
default:
break;

1 comment on commit b507f10

@Voyager1

This comment has been minimized.

Show comment
Hide comment
@Voyager1

Voyager1 Dec 7, 2012

Member

Note that this is an accident - I pushed the wrong button in SmartGit (commit is immediately reversed).

Member

Voyager1 commented on b507f10 Dec 7, 2012

Note that this is an accident - I pushed the wrong button in SmartGit (commit is immediately reversed).

Please sign in to comment.