Skip to content
Browse files

re enable manually add to library

  • Loading branch information...
1 parent ae60d24 commit b507f10d44843cac48e81640c4b241c860dc479e @Voyager1 Voyager1 committed
Showing with 20 additions and 0 deletions.
  1. +7 −0 xbmc/video/windows/GUIWindowVideoBase.cpp
  2. +13 −0 xbmc/video/windows/GUIWindowVideoNav.cpp
View
7 xbmc/video/windows/GUIWindowVideoBase.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();
View
13 xbmc/video/windows/GUIWindowVideoNav.cpp
@@ -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
Team Kodi member

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

Please sign in to comment.
Something went wrong with that request. Please try again.