added: Ticket #8990 - Production country for movies, thanks to ventech
authorjmarshallnz <jmarshallnz@svn>
Fri, 7 May 2010 09:41:49 +0000 (09:41 +0000)
committerjmarshallnz <jmarshallnz@svn>
Fri, 7 May 2010 09:41:49 +0000 (09:41 +0000)
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@29886 568bbfeb-2a22-0410-94d2-cc84cf5bfa90

30 files changed:
XBMC.xcodeproj/project.pbxproj
addons/com.imdb.scraper/imdb.xml
addons/metadata.themoviedb.org/tmdb.xml
language/English/strings.xml
language/Norwegian/strings.xml
xbmc/FileItem.cpp
xbmc/FileSystem/PluginDirectory.cpp
xbmc/FileSystem/VideoDatabaseDirectory.cpp
xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNode.cpp
xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNode.h
xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeCountry.cpp [new file with mode: 0644]
xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeCountry.h [new file with mode: 0644]
xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeMoviesOverview.cpp
xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeTitleMovies.cpp
xbmc/FileSystem/VideoDatabaseDirectory/Makefile
xbmc/FileSystem/VideoDatabaseDirectory/QueryParams.cpp
xbmc/FileSystem/VideoDatabaseDirectory/QueryParams.h
xbmc/GUIDialogSmartPlaylistRule.cpp
xbmc/GUIViewStateVideo.cpp
xbmc/GUIWindowVideoNav.cpp
xbmc/SmartPlaylist.cpp
xbmc/SmartPlaylist.h
xbmc/SortFileItem.cpp
xbmc/SortFileItem.h
xbmc/VideoDatabase.cpp
xbmc/VideoDatabase.h
xbmc/VideoInfoTag.cpp
xbmc/VideoInfoTag.h
xbmc/utils/GUIInfoManager.cpp
xbmc/utils/GUIInfoManager.h

index 331fa92..9f4a73b 100644 (file)
                7CCF7F1E1069F3AE00992676 /* Builtins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCF7F1B1069F3AE00992676 /* Builtins.cpp */; };
                7CCF7FC9106A0DF500992676 /* TimeUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCF7FC7106A0DF500992676 /* TimeUtils.cpp */; };
                7CCF7FCA106A0DF500992676 /* TimeUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CCF7FC7106A0DF500992676 /* TimeUtils.cpp */; };
+               7CD2C3AA11940B270009EFC1 /* DirectoryNodeCountry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CD2C3A811940B270009EFC1 /* DirectoryNodeCountry.cpp */; };
+               7CD2C3AB11940B270009EFC1 /* DirectoryNodeCountry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CD2C3A811940B270009EFC1 /* DirectoryNodeCountry.cpp */; };
                7CDAE9050FFCA3520040B25F /* DVDTSCorrection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CDAE9030FFCA3520040B25F /* DVDTSCorrection.cpp */; };
                7CDAE9060FFCA3520040B25F /* DVDTSCorrection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CDAE9030FFCA3520040B25F /* DVDTSCorrection.cpp */; };
                7CDAEA7D1001CD6E0040B25F /* karaokelyricstextustar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7CDAEA7B1001CD6E0040B25F /* karaokelyricstextustar.cpp */; };
                7CCF7F1C1069F3AE00992676 /* Builtins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Builtins.h; sourceTree = "<group>"; };
                7CCF7FC7106A0DF500992676 /* TimeUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimeUtils.cpp; sourceTree = "<group>"; };
                7CCF7FC8106A0DF500992676 /* TimeUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TimeUtils.h; sourceTree = "<group>"; };
+               7CD2C3A811940B270009EFC1 /* DirectoryNodeCountry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DirectoryNodeCountry.cpp; sourceTree = "<group>"; };
+               7CD2C3A911940B270009EFC1 /* DirectoryNodeCountry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DirectoryNodeCountry.h; sourceTree = "<group>"; };
                7CDAE9030FFCA3520040B25F /* DVDTSCorrection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DVDTSCorrection.cpp; sourceTree = "<group>"; };
                7CDAE9040FFCA3520040B25F /* DVDTSCorrection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DVDTSCorrection.h; sourceTree = "<group>"; };
                7CDAEA7B1001CD6E0040B25F /* karaokelyricstextustar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = karaokelyricstextustar.cpp; path = karaoke/karaokelyricstextustar.cpp; sourceTree = "<group>"; };
                E38E175F0D25F9FA00618676 /* VideoDatabaseDirectory */ = {
                        isa = PBXGroup;
                        children = (
+                               7CD2C3A811940B270009EFC1 /* DirectoryNodeCountry.cpp */,
+                               7CD2C3A911940B270009EFC1 /* DirectoryNodeCountry.h */,
                                E38E17600D25F9FA00618676 /* DirectoryNode.cpp */,
                                E38E17610D25F9FA00618676 /* DirectoryNode.h */,
                                E38E17620D25F9FA00618676 /* DirectoryNodeActor.cpp */,
                                18E9C8EE11834DF600DF8B9F /* GUIDialogAddonInfo.cpp in Sources */,
                                F52B063B11869862004B1D66 /* Skin.cpp in Sources */,
                                F52B06BA1187CE18004B1D66 /* DVDVideoCodecVDA.cpp in Sources */,
+                               7CD2C3AB11940B270009EFC1 /* DirectoryNodeCountry.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                18E9C8EF11834DF600DF8B9F /* GUIDialogAddonInfo.cpp in Sources */,
                                F52B063C11869862004B1D66 /* Skin.cpp in Sources */,
                                F52B06BB1187CE18004B1D66 /* DVDVideoCodecVDA.cpp in Sources */,
+                               7CD2C3AA11940B270009EFC1 /* DirectoryNodeCountry.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index cf035ad..0fc5348 100644 (file)
@@ -94,6 +94,9 @@
                        <RegExp input="$$1" output="&lt;genre&gt;\1&lt;/genre&gt;" dest="5+">
                                <expression repeat="yes">&quot;/Sections/Genres/[^/]*/&quot;&gt;([^&lt;]*)&lt;/a&gt;</expression>
                        </RegExp>
+                       <RegExp input="$$1" output="&lt;country&gt;\1&lt;/country&gt;" dest="5+">
+                               <expression repeat="yes">&quot;/Sections/Countries/[^/]*/&quot;&gt;([^&lt;]*)&lt;/a&gt;</expression>
+                       </RegExp>
                        <RegExp input="$$1" output="&lt;studio&gt;\1&lt;/studio&gt;" dest="5+">
                                <expression repeat="yes">&quot;/company/[^/]*/&quot;&gt;([^&lt;]*)&lt;/a&gt;</expression>
                        </RegExp>
index ec857de..1070cd7 100644 (file)
@@ -66,6 +66,9 @@
                        <RegExp input="$$1" output="&lt;studio&gt;\1&lt;/studio&gt;" dest="5+">
                                <expression repeat="yes">&lt;studio.*?name=&quot;([^&quot;]*)&quot;</expression>
                        </RegExp>
+                       <RegExp input="$$1" output="&lt;country&gt;\1&lt;/country&gt;" dest="5+">
+                               <expression repeat="yes">&lt;country.*?name=&quot;([^&quot;]*)&quot;</expression>
+                       </RegExp>
                        <RegExp input="$$1" output="&lt;plot&gt;\1&lt;/plot&gt;" dest="5+">
                                <expression>&lt;overview&gt;([^&lt;]*)&lt;/overview&gt;</expression>
                        </RegExp>
index b63d4a8..20a3e4d 100644 (file)
   <string id="571">Default</string>
   <string id="572">Studio</string>
   <string id="573">Path</string>
+  <string id="574">Country</string>
 
   <string id="580">Sort direction</string>
   <string id="581">Sort method</string>
   <string id="20448">Could not download information</string>
   <string id="20449">Server is most likely unavailable.</string>
   <string id="20450">Would you like to continue scanning?</string>
+  <string id="20451">Countries</string>
   <!-- up to 21329 is reserved for the video db !! !-->
 
   <string id="21330">Show hidden files and directories</string>
index 5de8098..aae92b3 100644 (file)
   <string id="571">Standard</string>
   <string id="572">Studio</string>
   <string id="573">Sti</string>
+  <string id="574">Land</string>
   <string id="580">Sorteringsretning</string>
   <string id="581">Sorteringsmetode</string>
   <string id="582">Visningsmodus</string>
index 3bae8bc..20d25e7 100644 (file)
@@ -1489,6 +1489,9 @@ void CFileItemList::Sort(SORT_METHOD sortMethod, SORT_ORDER sortOrder)
   case SORT_METHOD_GENRE:
     FillSortFields(SSortFileItem::ByGenre);
     break;
+  case SORT_METHOD_COUNTRY:
+    FillSortFields(SSortFileItem::ByCountry);
+    break;
   case SORT_METHOD_FILE:
     FillSortFields(SSortFileItem::ByFile);
     break;
index 1fc5ac4..8c943a5 100644 (file)
@@ -299,6 +299,11 @@ void CPluginDirectory::AddSortMethod(int handle, SORT_METHOD sortMethod)
         dir->m_listItems->AddSortMethod(SORT_METHOD_GENRE, 515, LABEL_MASKS("%T", "%G"));
         break;
       }
+    case SORT_METHOD_COUNTRY:
+      {
+        dir->m_listItems->AddSortMethod(SORT_METHOD_COUNTRY, 574, LABEL_MASKS("%T", "%G"));
+        break;
+      }
     case SORT_METHOD_VIDEO_TITLE:
       {
         dir->m_listItems->AddSortMethod(SORT_METHOD_VIDEO_TITLE, 369, LABEL_MASKS("%T", "%D"));
index 8365e79..cba7403 100644 (file)
@@ -155,6 +155,13 @@ bool CVideoDatabaseDirectory::GetLabel(const CStdString& strDirectory, CStdStrin
     strLabel += strTemp;
   }
 
+  // get country
+  if (params.GetCountryId() != -1)
+  {
+    videodatabase.GetCountryById(params.GetCountryId(), strTemp);
+    strLabel += strTemp;
+  }
+
   // get set
   if (params.GetSetId() != -1)
   {
@@ -183,6 +190,8 @@ bool CVideoDatabaseDirectory::GetLabel(const CStdString& strDirectory, CStdStrin
       strLabel = g_localizeStrings.Get(344); break;
     case NODE_TYPE_GENRE: // Genres
       strLabel = g_localizeStrings.Get(135); break;
+    case NODE_TYPE_COUNTRY: // Countries
+      strLabel = g_localizeStrings.Get(20451); break;
     case NODE_TYPE_YEAR: // Year
       strLabel = g_localizeStrings.Get(562); break;
     case NODE_TYPE_DIRECTOR: // Director
@@ -244,6 +253,8 @@ CStdString CVideoDatabaseDirectory::GetIcon(const CStdString &strDirectory)
     return "DefaultActor.png";
   case NODE_TYPE_GENRE: // Genres
     return "DefaultGenre.png";
+  case NODE_TYPE_COUNTRY: // Countries
+    return "DefaultCountry.png";
   case NODE_TYPE_SETS: // Sets
     return "DefaultSets.png";
   case NODE_TYPE_YEAR: // Year
index 4224609..d4a6a5b 100644 (file)
@@ -25,6 +25,7 @@
 #include "DirectoryNodeRoot.h"
 #include "DirectoryNodeOverview.h"
 #include "DirectoryNodeGenre.h"
+#include "DirectoryNodeCountry.h"
 #include "DirectoryNodeSets.h"
 #include "DirectoryNodeTitleMovies.h"
 #include "DirectoryNodeTitleTvShows.h"
@@ -115,6 +116,8 @@ CDirectoryNode* CDirectoryNode::CreateNode(NODE_TYPE Type, const CStdString& str
     return new CDirectoryNodeOverview(strName, pParent);
   case NODE_TYPE_GENRE:
     return new CDirectoryNodeGenre(strName, pParent);
+  case NODE_TYPE_COUNTRY:
+    return new CDirectoryNodeCountry(strName, pParent);
   case NODE_TYPE_SETS:
     return new CDirectoryNodeSets(strName, pParent);
   case NODE_TYPE_YEAR:
index 1b412fa..3908ee6 100644 (file)
@@ -53,7 +53,8 @@ namespace XFILE
       NODE_TYPE_RECENTLY_ADDED_MUSICVIDEOS,
       NODE_TYPE_TITLE_MUSICVIDEOS,
       NODE_TYPE_MUSICVIDEOS_ALBUM,
-      NODE_TYPE_SETS
+      NODE_TYPE_SETS,
+      NODE_TYPE_COUNTRY
     } NODE_TYPE;
 
     class CDirectoryNode
diff --git a/xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeCountry.cpp b/xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeCountry.cpp
new file mode 100644 (file)
index 0000000..d5b7cba
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ *      Copyright (C) 2005-2008 Team XBMC
+ *      http://www.xbmc.org
+ *
+ *  This Program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This Program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with XBMC; see the file COPYING.  If not, write to
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "DirectoryNodeCountry.h"
+#include "QueryParams.h"
+#include "VideoDatabase.h"
+
+using namespace XFILE::VIDEODATABASEDIRECTORY;
+
+CDirectoryNodeCountry::CDirectoryNodeCountry(const CStdString& strName, CDirectoryNode* pParent)
+  : CDirectoryNode(NODE_TYPE_COUNTRY, strName, pParent)
+{
+
+}
+
+NODE_TYPE CDirectoryNodeCountry::GetChildType()
+{
+  CQueryParams params;
+  CollectQueryParams(params);
+  return NODE_TYPE_TITLE_MOVIES;
+}
+
+bool CDirectoryNodeCountry::GetContent(CFileItemList& items)
+{
+  CVideoDatabase videodatabase;
+  if (!videodatabase.Open())
+    return false;
+
+  CQueryParams params;
+  CollectQueryParams(params);
+
+  bool bSuccess=videodatabase.GetCountriesNav(BuildPath(), items, params.GetContentType());
+
+  videodatabase.Close();
+
+  return bSuccess;
+}
diff --git a/xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeCountry.h b/xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeCountry.h
new file mode 100644 (file)
index 0000000..7a2a7bd
--- /dev/null
@@ -0,0 +1,40 @@
+#pragma once
+/*
+ *      Copyright (C) 2005-2008 Team XBMC
+ *      http://www.xbmc.org
+ *
+ *  This Program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2, or (at your option)
+ *  any later version.
+ *
+ *  This Program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with XBMC; see the file COPYING.  If not, write to
+ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ *  http://www.gnu.org/copyleft/gpl.html
+ *
+ */
+
+#include "DirectoryNode.h"
+
+namespace XFILE
+{
+  namespace VIDEODATABASEDIRECTORY
+  {
+    class CDirectoryNodeCountry : public CDirectoryNode
+    {
+    public:
+      CDirectoryNodeCountry(const CStdString& strName, CDirectoryNode* pParent);
+    protected:
+      virtual NODE_TYPE GetChildType();
+      virtual bool GetContent(CFileItemList& items);
+    };
+  }
+}
+
+
index 532373b..c94b5c6 100644 (file)
@@ -47,6 +47,8 @@ NODE_TYPE CDirectoryNodeMoviesOverview::GetChildType()
   else if (GetName()=="6")
     return NODE_TYPE_STUDIO;
   else if (GetName()=="7")
+    return NODE_TYPE_COUNTRY;
+  else if (GetName()=="8")
     return NODE_TYPE_SETS;
 
   return NODE_TYPE_NONE;
@@ -61,6 +63,7 @@ bool CDirectoryNodeMoviesOverview::GetContent(CFileItemList& items)
   vecRoot.push_back(g_localizeStrings.Get(344));  // Actors
   vecRoot.push_back(g_localizeStrings.Get(20348));  // Directors
   vecRoot.push_back(g_localizeStrings.Get(20388));  // Studios
+  vecRoot.push_back(g_localizeStrings.Get(20451));  // Countries
   CVideoDatabase db;
   if (db.Open())
   {
index a7a1a71..c1d950e 100644 (file)
@@ -41,7 +41,7 @@ bool CDirectoryNodeTitleMovies::GetContent(CFileItemList& items)
   CollectQueryParams(params);
 
   CStdString strBaseDir=BuildPath();
-  bool bSuccess=videodatabase.GetMoviesNav(strBaseDir, items, params.GetGenreId(), params.GetYear(), params.GetActorId(), params.GetDirectorId(),params.GetStudioId(),params.GetSetId());
+  bool bSuccess=videodatabase.GetMoviesNav(strBaseDir, items, params.GetGenreId(), params.GetYear(), params.GetActorId(), params.GetDirectorId(), params.GetStudioId(), params.GetCountryId(), params.GetSetId());
 
   videodatabase.Close();
 
index 7be6a8f..e083379 100644 (file)
@@ -5,6 +5,7 @@ SRCS=DirectoryNodeActor.cpp \
      DirectoryNodeDirector.cpp \
      DirectoryNodeEpisodes.cpp \
      DirectoryNodeGenre.cpp \
+     DirectoryNodeCountry.cpp \
      DirectoryNodeSets.cpp \
      DirectoryNodeMoviesOverview.cpp \
      DirectoryNodeOverview.cpp \
index a3b0988..ea84cbe 100644 (file)
@@ -27,6 +27,7 @@ CQueryParams::CQueryParams()
 {
   m_idMovie = -1;
   m_idGenre = -1;
+  m_idCountry = -1;
   m_idYear = -1;
   m_idActor = -1;
   m_idDirector = -1;
@@ -52,6 +53,9 @@ void CQueryParams::SetQueryParam(NODE_TYPE NodeType, const CStdString& strNodeNa
   case NODE_TYPE_GENRE:
     m_idGenre = idDb;
     break;
+  case NODE_TYPE_COUNTRY:
+    m_idCountry = idDb;
+    break;
   case NODE_TYPE_YEAR:
     m_idYear = idDb;
     break;
index 6839cc6..60adaea 100644 (file)
@@ -34,6 +34,7 @@ namespace XFILE
       long GetMovieId() const { return m_idMovie; }
       long GetYear() const { return m_idYear; }
       long GetGenreId() const { return m_idGenre; }
+      long GetCountryId() const { return m_idCountry; }
       long GetActorId() const { return m_idActor; }
       long GetAlbumId() const { return m_idAlbum; }
       long GetDirectorId() const { return m_idDirector; }
@@ -52,6 +53,7 @@ namespace XFILE
       long m_idContent;
       long m_idMovie;
       long m_idGenre;
+      long m_idCountry;
       long m_idYear;
       long m_idActor;
       long m_idDirector;
index e4ccdf1..0a55195 100644 (file)
@@ -119,6 +119,11 @@ void CGUIDialogSmartPlaylistRule::OnBrowse()
     }
     iLabel = 515;
   }
+  else if (m_rule.m_field == CSmartPlaylistRule::FIELD_COUNTRY)
+  {
+    videodatabase.GetCountriesNav("videodb://2/1/",items,type);
+    iLabel = 574;
+  }
   else if (m_rule.m_field == CSmartPlaylistRule::FIELD_ARTIST || m_rule.m_field == CSmartPlaylistRule::FIELD_ALBUMARTIST)
   {
     if (m_type.Equals("songs") || m_type.Equals("mixed") || m_type.Equals("albums"))
index 6d6208b..28e5e46 100644 (file)
@@ -173,6 +173,7 @@ CGUIViewStateWindowVideoNav::CGUIViewStateWindowVideoNav(const CFileItemList& it
       break;
     case NODE_TYPE_MUSICVIDEOS_ALBUM:
     case NODE_TYPE_GENRE:
+    case NODE_TYPE_COUNTRY:
     case NODE_TYPE_STUDIO:
       {
         AddSortMethod(SORT_METHOD_LABEL, 551, LABEL_MASKS("%T", "%R", "%L", ""));  // Filename, Duration | Foldername, empty
index af4f7cf..04a882e 100644 (file)
@@ -161,6 +161,8 @@ bool CGUIWindowVideoNav::OnMessage(CGUIMessage& message)
           destPath = "videodb://1/5/";
         else if (strDestination.Equals("MovieStudios"))
           destPath = "videodb://1/6/";
+        else if (strDestination.Equals("MovieCountries"))
+          destPath = "videodb://1/7/";
         else if (strDestination.Equals("Movies"))
           destPath = "videodb://1/";
         else if (strDestination.Equals("MovieSets"))
@@ -485,22 +487,24 @@ bool CGUIWindowVideoNav::GetDirectory(const CStdString &strDirectory, CFileItemL
         items.SetContent("musicvideos");
       else if (node == NODE_TYPE_GENRE)
         items.SetContent("genres");
-     else if (node == NODE_TYPE_ACTOR)
-     {
-       if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
-         items.SetContent("artists");
-       else
-         items.SetContent("actors");
-     }
-     else if (node == NODE_TYPE_DIRECTOR)
-       items.SetContent("directors");
-     else if (node == NODE_TYPE_STUDIO)
-       items.SetContent("studios");
-     else if (node == NODE_TYPE_YEAR)
-       items.SetContent("years");
-     else if (node == NODE_TYPE_MUSICVIDEOS_ALBUM)
-       items.SetContent("albums");
-     else
+      else if (node == NODE_TYPE_COUNTRY)
+        items.SetContent("countries");
+      else if (node == NODE_TYPE_ACTOR)
+      {
+        if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
+          items.SetContent("artists");
+        else
+          items.SetContent("actors");
+      }
+      else if (node == NODE_TYPE_DIRECTOR)
+        items.SetContent("directors");
+      else if (node == NODE_TYPE_STUDIO)
+        items.SetContent("studios");
+      else if (node == NODE_TYPE_YEAR)
+        items.SetContent("years");
+      else if (node == NODE_TYPE_MUSICVIDEOS_ALBUM)
+        items.SetContent("albums");
+      else
         items.SetContent("");
     }
   }
index c6a4115..0f38d10 100644 (file)
@@ -69,6 +69,7 @@ static const translateField fields[] = { { "none", CSmartPlaylistRule::FIELD_NON
                                          { "director", CSmartPlaylistRule::FIELD_DIRECTOR, CSmartPlaylistRule::BROWSEABLE_FIELD, 20339 },
                                          { "actor", CSmartPlaylistRule::FIELD_ACTOR, CSmartPlaylistRule::BROWSEABLE_FIELD, 20337 },
                                          { "studio", CSmartPlaylistRule::FIELD_STUDIO, CSmartPlaylistRule::BROWSEABLE_FIELD, 572 },
+                                         { "country", CSmartPlaylistRule::FIELD_COUNTRY, CSmartPlaylistRule::BROWSEABLE_FIELD, 574 },
                                          { "numepisodes", CSmartPlaylistRule::FIELD_NUMEPISODES, CSmartPlaylistRule::NUMERIC_FIELD, 20360 },
                                          { "numwatched", CSmartPlaylistRule::FIELD_NUMWATCHED, CSmartPlaylistRule::NUMERIC_FIELD, 21441 },
                                          { "writers", CSmartPlaylistRule::FIELD_WRITER, CSmartPlaylistRule::BROWSEABLE_FIELD, 20417 },
@@ -284,6 +285,7 @@ vector<CSmartPlaylistRule::DATABASE_FIELD> CSmartPlaylistRule::GetFields(const C
     fields.push_back(FIELD_PLAYCOUNT);
     fields.push_back(FIELD_LASTPLAYED);
     fields.push_back(FIELD_GENRE);
+    fields.push_back(FIELD_COUNTRY);
     fields.push_back(FIELD_YEAR); // premiered
     fields.push_back(FIELD_DIRECTOR);
     if (!sortOrders)
@@ -494,6 +496,8 @@ CStdString CSmartPlaylistRule::GetWhereClause(const CStdString& strType)
       query = "idmovie" + negate + " in (select idmovie from writerlinkmovie join actors on actors.idactor=writerlinkmovie.idwriter where actors.strActor" + parameter + ")";
     else if (m_field == FIELD_STUDIO)
       query = "idmovie" + negate + " in (select idmovie from studiolinkmovie join studio on studio.idstudio=studiolinkmovie.idstudio where studio.strStudio" + parameter + ")";
+    else if (m_field == FIELD_COUNTRY)
+      query = "idmovie" + negate + " in (select idmovie from countrylinkmovie join country on country.idcountry=countrylinkmovie.idcountry where country.strCountry" + parameter + ")";
     else if (m_field == FIELD_HASTRAILER)
       query = negate + GetDatabaseField(m_field, strType) + "!= ''";
     else if (m_field == FIELD_LASTPLAYED && (m_operator == OPERATOR_LESS_THAN || m_operator == OPERATOR_BEFORE || m_operator == OPERATOR_NOT_IN_THE_LAST))
@@ -643,6 +647,7 @@ CStdString CSmartPlaylistRule::GetDatabaseField(DATABASE_FIELD field, const CStd
     else if (field == FIELD_MPAA) result.Format("c%02d", VIDEODB_ID_MPAA);
     else if (field == FIELD_TOP250) result.Format("c%02d", VIDEODB_ID_TOP250);
     else if (field == FIELD_STUDIO) result.Format("c%02d", VIDEODB_ID_STUDIOS);   // join required
+    else if (field == FIELD_COUNTRY) result.Format("c%02d", VIDEODB_ID_COUNTRY);    // join required
     else if (field == FIELD_HASTRAILER) result.Format("c%02d", VIDEODB_ID_TRAILER);
     else if (field == FIELD_FILENAME) result = "strFilename";
     else if (field == FIELD_PATH) result = "strPath";
index 29b20bb..392bbf8 100644 (file)
@@ -55,6 +55,7 @@ public:
                         FIELD_DIRECTOR,
                         FIELD_ACTOR,
                         FIELD_STUDIO,
+                        FIELD_COUNTRY,
                         FIELD_MPAA,
                         FIELD_TOP250,
                         FIELD_NUMEPISODES,
index 95d28fe..b16c039 100644 (file)
@@ -336,6 +336,13 @@ void SSortFileItem::ByGenre(CFileItemPtr &item)
     item->SetSortLabel(item->GetVideoInfoTag()->m_strGenre);
 }
 
+void SSortFileItem::ByCountry(CFileItemPtr &item)
+{
+  if (!item) return;
+  item->SetSortLabel(item->GetVideoInfoTag()->m_strCountry);
+}
+
+
 void SSortFileItem::ByYear(CFileItemPtr &item)
 {
   if (!item) return;
index a4dc685..fa5e98d 100644 (file)
@@ -54,6 +54,7 @@ struct SSortFileItem
   static void ByProgramCount(CFileItemPtr &item);
 
   static void ByGenre(CFileItemPtr &item);
+  static void ByCountry(CFileItemPtr &item);
   static void ByYear(CFileItemPtr &item);
 
   static void ByMovieTitle(CFileItemPtr &item);
@@ -86,6 +87,7 @@ typedef enum {
   SORT_METHOD_ALBUM,
   SORT_METHOD_ALBUM_IGNORE_THE,
   SORT_METHOD_GENRE,
+  SORT_METHOD_COUNTRY,
   SORT_METHOD_YEAR,
   SORT_METHOD_VIDEO_RATING,
   SORT_METHOD_PROGRAM_COUNT,
index f5df89d..0cadb4d 100644 (file)
@@ -122,6 +122,14 @@ bool CVideoDatabase::CreateTables()
     m_pDS->exec("CREATE UNIQUE INDEX ix_genrelinkmovie_1 ON genrelinkmovie ( idGenre, idMovie)\n");
     m_pDS->exec("CREATE UNIQUE INDEX ix_genrelinkmovie_2 ON genrelinkmovie ( idMovie, idGenre)\n");
 
+    CLog::Log(LOGINFO, "create country table");
+    m_pDS->exec("CREATE TABLE country ( idCountry integer primary key, strCountry text)\n");
+
+    CLog::Log(LOGINFO, "create countrylinkmovie table");
+    m_pDS->exec("CREATE TABLE countrylinkmovie ( idCountry integer, idMovie integer)\n");
+    m_pDS->exec("CREATE UNIQUE INDEX ix_countrylinkmovie_1 ON countrylinkmovie ( idCountry, idMovie)\n");
+    m_pDS->exec("CREATE UNIQUE INDEX ix_countrylinkmovie_2 ON countrylinkmovie ( idMovie, idCountry)\n");
+
     CLog::Log(LOGINFO, "create movie table");
     CStdString columns = "CREATE TABLE movie ( idMovie integer primary key, idFile integer";
     for (int i = 0; i < VIDEODB_MAX_COLUMNS; i++)
@@ -1047,6 +1055,11 @@ int CVideoDatabase::AddStudio(const CStdString& strStudio)
 }
 
 //********************************************************************************************************************************
+int CVideoDatabase::AddCountry(const CStdString& strCountry)
+{
+  return AddToTable("country", "idCountry", "strCountry", strCountry);
+}
+
 int CVideoDatabase::AddActor(const CStdString& strActor, const CStdString& strThumb)
 {
   try
@@ -1221,6 +1234,12 @@ void CVideoDatabase::AddGenreToMusicVideo(int idMVideo, int idGenre)
   AddToLinkTable("genrelinkmusicvideo", "idGenre", idGenre, "idMVideo", idMVideo);
 }
 
+//****Country****
+void CVideoDatabase::AddCountryToMovie(int idMovie, int idCountry)
+{
+  AddToLinkTable("countrylinkmovie", "idCountry", idCountry, "idMovie", idMovie);
+}
+
 //********************************************************************************************************************************
 bool CVideoDatabase::HasMovieInfo(const CStdString& strFilenameAndPath)
 {
@@ -1669,6 +1688,20 @@ int CVideoDatabase::SetDetailsForMovie(const CStdString& strFilenameAndPath, con
       }
     }
 
+    // add countries...
+    if (!info.m_strCountry.IsEmpty())
+    {
+      CStdStringArray countries;
+      StringUtils::SplitString(info.m_strCountry, g_advancedSettings.m_videoItemSeparator, countries);
+      for (unsigned int i = 0; i < countries.size(); i++)
+      {
+        CStdString country(countries[i]);
+        country.Trim();
+        int idCountry = AddCountry(country);
+        AddCountryToMovie(idMovie, idCountry);
+      }
+    }
+
     if (details.HasStreamDetails())
       SetStreamDetailsForFileId(details.m_streamDetails, idFile);
 
@@ -2295,6 +2328,9 @@ void CVideoDatabase::DeleteMovie(const CStdString& strFilenameAndPath, bool bKee
     strSQL=FormatSQL("delete from setlinkmovie where idMovie=%i", idMovie);
     m_pDS->exec(strSQL.c_str());
 
+    strSQL=FormatSQL("delete from countrylinkmovie where idMovie=%i", idMovie);
+    m_pDS->exec(strSQL.c_str());
+
     if (!bKeepThumb)
       DeleteThumbForItem(strFilenameAndPath,false);
 
@@ -3689,6 +3725,21 @@ bool CVideoDatabase::UpdateOldVersion(int iVersion)
       m_pDS->exec("CREATE UNIQUE INDEX ix_musicvideo_file_1 on musicvideo (idMVideo, idFile)");
       m_pDS->exec("CREATE UNIQUE INDEX ix_musicvideo_file_2 on musicvideo (idFile, idMVideo)");
     }
+    if (iVersion < 38)
+    {
+      m_pDS->exec("ALTER table movie add c21 text");
+      m_pDS->exec("ALTER table episode add c21 text");
+      m_pDS->exec("ALTER table musicvideo add c21 text");
+      m_pDS->exec("ALTER table tvshow add c21 text");
+
+      CLog::Log(LOGINFO, "create country table");
+      m_pDS->exec("CREATE TABLE country ( idCountry integer primary key, strCountry text)\n");
+
+      CLog::Log(LOGINFO, "create countrylinkmovie table");
+      m_pDS->exec("CREATE TABLE countrylinkmovie ( idCountry integer, idMovie integer)\n");
+      m_pDS->exec("CREATE UNIQUE INDEX ix_countrylinkmovie_1 ON countrylinkmovie ( idCountry, idMovie)\n");
+      m_pDS->exec("CREATE UNIQUE INDEX ix_countrylinkmovie_2 ON countrylinkmovie ( idMovie, idCountry)\n");
+    }
   }
   catch (...)
   {
@@ -3847,6 +3898,11 @@ bool CVideoDatabase::GetGenresNav(const CStdString& strBaseDir, CFileItemList& i
   return GetNavCommon(strBaseDir, items, "genre", idContent);
 }
 
+bool CVideoDatabase::GetCountriesNav(const CStdString& strBaseDir, CFileItemList& items, int idContent)
+{
+  return GetNavCommon(strBaseDir, items, "country", idContent);
+}
+
 bool CVideoDatabase::GetStudiosNav(const CStdString& strBaseDir, CFileItemList& items, int idContent)
 {
   return GetNavCommon(strBaseDir, items, "studio", idContent);
@@ -4725,11 +4781,13 @@ bool CVideoDatabase::GetSeasonsNav(const CStdString& strBaseDir, CFileItemList&
   return false;
 }
 
-bool CVideoDatabase::GetMoviesNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre, int idYear, int idActor, int idDirector, int idStudio, int idSet)
+bool CVideoDatabase::GetMoviesNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre, int idYear, int idActor, int idDirector, int idStudio, int idCountry, int idSet)
 {
   CStdString where;
   if (idGenre != -1)
     where = FormatSQL("join genrelinkmovie on genrelinkmovie.idMovie=movieview.idMovie where genrelinkmovie.idGenre=%i", idGenre);
+  else if (idCountry != -1)
+    where = FormatSQL("join countrylinkmovie on countrylinkmovie.idMovie=movieview.idMovie where countrylinkmovie.idCountry=%i", idCountry);
   else if (idStudio != -1)
     where = FormatSQL("join studiolinkmovie on studiolinkmovie.idMovie=movieview.idMovie where studiolinkmovie.idStudio=%i", idStudio);
   else if (idDirector != -1)
@@ -5247,6 +5305,32 @@ bool CVideoDatabase::GetGenreById(int idGenre, CStdString& strGenre)
   return false;
 }
 
+bool CVideoDatabase::GetCountryById(int idCountry, CStdString& strCountry)
+{
+  try
+  {
+    if (NULL == m_pDB.get()) return false;
+    if (NULL == m_pDS.get()) return false;
+
+    CStdString strSQL=FormatSQL("select country.strCountry from country where country.idCountry=%i", idCountry);
+    m_pDS->query( strSQL.c_str() );
+
+    bool bResult = false;
+    if (!m_pDS->eof())
+    {
+      strCountry  = m_pDS->fv("country.strCountry").get_asString();
+      bResult = true;
+    }
+    m_pDS->close();
+    return bResult;
+  }
+  catch (...)
+  {
+    CLog::Log(LOGERROR, "%s (%s) failed", __FUNCTION__, strCountry.c_str());
+  }
+  return false;
+}
+
 bool CVideoDatabase::HasSets() const
 {
   try
@@ -5579,6 +5663,47 @@ void CVideoDatabase::GetMovieGenresByName(const CStdString& strSearch, CFileItem
   }
 }
 
+void CVideoDatabase::GetMovieCountriesByName(const CStdString& strSearch, CFileItemList& items)
+{
+  CStdString strSQL;
+
+  try
+  {
+    if (NULL == m_pDB.get()) return;
+    if (NULL == m_pDS.get()) return;
+
+    if (g_settings.GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE && !g_passwordManager.bMasterUser)
+      strSQL=FormatSQL("select country.idCountry,country.strCountry,path.strPath from country,countrylinkmovie,movie,path,files where country.idCountry=countrylinkmovie.idCountry and countrylinkmovie.idMovie=movie.idMovie and files.idFile=movie.idFile and path.idPath=files.idPath and country.strCountry like '%%%s%%'",strSearch.c_str());
+    else
+      strSQL=FormatSQL("select distinct country.idCountry,country.strCountry from country,countrylinkmovie where countrylinkmovie.idCountry=country.idCountry and strCountry like '%%%s%%'", strSearch.c_str());
+    m_pDS->query( strSQL.c_str() );
+
+    while (!m_pDS->eof())
+    {
+      if (g_settings.GetMasterProfile().getLockMode() != LOCK_MODE_EVERYONE && !g_passwordManager.bMasterUser)
+        if (!g_passwordManager.IsDatabasePathUnlocked(CStdString(m_pDS->fv("path.strPath").get_asString()),
+                                                      g_settings.m_videoSources))
+        {
+          m_pDS->next();
+          continue;
+        }
+
+      CFileItemPtr pItem(new CFileItem(m_pDS->fv("country.strCountry").get_asString()));
+      CStdString strDir;
+      strDir.Format("%ld/", m_pDS->fv("country.idCountry").get_asInt());
+      pItem->m_strPath="videodb://1/1/"+ strDir;
+      pItem->m_bIsFolder=true;
+      items.Add(pItem);
+      m_pDS->next();
+    }
+    m_pDS->close();
+  }
+  catch (...)
+  {
+    CLog::Log(LOGERROR, "%s (%s) failed", __FUNCTION__, strSQL.c_str());
+  }
+}
+
 void CVideoDatabase::GetTvShowGenresByName(const CStdString& strSearch, CFileItemList& items)
 {
   CStdString strSQL;
@@ -6624,6 +6749,10 @@ void CVideoDatabase::CleanDatabase(IVideoInfoScannerObserver* pObserver, const v
     sql = "delete from genrelinkmovie where idMovie in " + moviesToDelete;
     m_pDS->exec(sql.c_str());
 
+    CLog::Log(LOGDEBUG, "%s Cleaning countrylinkmovie table", __FUNCTION__);
+    sql = "delete from countrylinkmovie where idMovie in " + moviesToDelete;
+    m_pDS->exec(sql.c_str());
+
     CLog::Log(LOGDEBUG, "%s Cleaning studiolinkmovie table", __FUNCTION__);
     sql = "delete from studiolinkmovie where idMovie in " + moviesToDelete;
     m_pDS->exec(sql.c_str());
@@ -6732,6 +6861,10 @@ void CVideoDatabase::CleanDatabase(IVideoInfoScannerObserver* pObserver, const v
     sql = "delete from genre where idGenre not in (select distinct idGenre from genrelinkmovie) and idGenre not in (select distinct idGenre from genrelinktvshow) and idGenre not in (select distinct idGenre from genrelinkmusicvideo)";
     m_pDS->exec(sql.c_str());
 
+    CLog::Log(LOGDEBUG, "%s Cleaning country table", __FUNCTION__);
+    sql = "delete from country where idCountry not in (select distinct idCountry from countrylinkmovie)";
+    m_pDS->exec(sql.c_str());
+
     CLog::Log(LOGDEBUG, "%s Cleaning actor table of actors, directors and writers", __FUNCTION__);
     sql = "delete from actors where idActor not in (select distinct idActor from actorlinkmovie) and idActor not in (select distinct idDirector from directorlinkmovie) and idActor not in (select distinct idWriter from writerlinkmovie) and idActor not in (select distinct idActor from actorlinktvshow) and idActor not in (select distinct idActor from actorlinkepisode) and idActor not in (select distinct idDirector from directorlinktvshow) and idActor not in (select distinct idDirector from directorlinkepisode) and idActor not in (select distinct idWriter from writerlinkepisode) and idActor not in (select distinct idArtist from artistlinkmusicvideo) and idActor not in (select distinct idDirector from directorlinkmusicvideo)";
     m_pDS->exec(sql.c_str());
index 662bcfa..cb7ba37 100644 (file)
@@ -59,7 +59,7 @@ namespace VIDEO
 
 // these defines are based on how many columns we have and which column certain data is going to be in
 // when we do GetDetailsForMovie()
-#define VIDEODB_MAX_COLUMNS 21
+#define VIDEODB_MAX_COLUMNS 22
 #define VIDEODB_DETAILS_FILEID                 1
 #define VIDEODB_DETAILS_FILE                   VIDEODB_MAX_COLUMNS + 2
 #define VIDEODB_DETAILS_PATH                   VIDEODB_MAX_COLUMNS + 3
@@ -115,6 +115,7 @@ typedef enum // this enum MUST match the offset struct further down!! and make s
   VIDEODB_ID_STUDIOS = 18,
   VIDEODB_ID_TRAILER = 19,
   VIDEODB_ID_FANART = 20,
+  VIDEODB_ID_COUNTRY = 21,
   VIDEODB_ID_MAX
 } VIDEODB_IDS;
 
@@ -144,7 +145,8 @@ const struct SDbTableOffsets
   { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_spoof) },
   { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strStudio) },
   { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strTrailer) },
-  { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_fanart.m_xml) }
+  { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_fanart.m_xml) },
+  { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strCountry) }
 };
 
 typedef enum // this enum MUST match the offset struct further down!! and make sure to keep min and max at -1 and sizeof(offsets)
@@ -337,6 +339,7 @@ public:
 
   void GetFilePathById(int idMovie, CStdString &filePath, VIDEODB_CONTENT_TYPE iType);
   bool GetGenreById(int idGenre, CStdString& strGenre);
+  bool GetCountryById(int idCountry, CStdString& strCountry);
   bool GetSetById(int idSet, CStdString& strSet);
   int GetTvShowForEpisode(int idEpisode);
 
@@ -425,6 +428,8 @@ public:
   void GetTvShowGenresByName(const CStdString& strSearch, CFileItemList& items);
   void GetMusicVideoGenresByName(const CStdString& strSearch, CFileItemList& items);
 
+  void GetMovieCountriesByName(const CStdString& strSearch, CFileItemList& items);
+
   void GetMusicVideoAlbumsByName(const CStdString& strSearch, CFileItemList& items);
 
   void GetMovieActorsByName(const CStdString& strSearch, CFileItemList& items);
@@ -453,15 +458,16 @@ public:
 
   // general browsing
   bool GetGenresNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1);
+  bool GetCountriesNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1);
   bool GetStudiosNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1);
+  bool GetYearsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1);
   bool GetActorsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1);
   bool GetDirectorsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1);
   bool GetWritersNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1);
-  bool GetYearsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1);
   bool GetSetsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const CStdString &where = "");
   bool GetMusicVideoAlbumsNav(const CStdString& strBaseDir, CFileItemList& items, int idArtist);
 
-  bool GetMoviesNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idStudio=-1, int idSet=-1);
+  bool GetMoviesNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idStudio=-1, int idCountry=-1, int idSet=-1);
   bool GetTvShowsNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idStudio=-1);
   bool GetSeasonsNav(const CStdString& strBaseDir, CFileItemList& items, int idActor=-1, int idDirector=-1, int idGenre=-1, int idYear=-1, int idShow=-1);
   bool GetEpisodesNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idShow=-1, int idSeason=-1);
@@ -512,8 +518,10 @@ protected:
   int AddToTable(const CStdString& table, const CStdString& firstField, const CStdString& secondField, const CStdString& value);
   int AddGenre(const CStdString& strGenre1);
   int AddActor(const CStdString& strActor, const CStdString& strThumb);
+  int AddCountry(const CStdString& strCountry);
   int AddSet(const CStdString& strSet);
   int AddStudio(const CStdString& strStudio1);
+
   int AddTvShow(const CStdString& strPath);
   int AddMusicVideo(const CStdString& strFilenameAndPath);
 
@@ -543,6 +551,8 @@ protected:
   void AddStudioToTvShow(int idTvShow, int idStudio);
   void AddStudioToMusicVideo(int idMVideo, int idStudio);
 
+  void AddCountryToMovie(int idMovie, int idCountry);
+
   void AddGenreAndDirectorsAndStudios(const CVideoInfoTag& details, std::vector<int>& vecDirectors, std::vector<int>& vecGenres, std::vector<int>& vecStudios);
 
   void DeleteStreamDetails(int idFile);
@@ -561,7 +571,7 @@ protected:
 private:
   virtual bool CreateTables();
   virtual bool UpdateOldVersion(int version);
-  virtual int GetMinVersion() const { return 37; };
+  virtual int GetMinVersion() const { return 38; };
   const char *GetDefaultDBName() const { return "MyVideos34.db"; };
 
   void ConstructPath(CStdString& strDest, const CStdString& strPath, const CStdString& strFileName);
index 1480eff..a0c43cc 100644 (file)
@@ -36,6 +36,7 @@ void CVideoInfoTag::Reset()
   m_strDirector = "";
   m_strWritingCredits = "";
   m_strGenre = "";
+  m_strCountry = "";
   m_strTagLine = "";
   m_strPlotOutline = "";
   m_strPlot = "";
@@ -153,6 +154,8 @@ bool CVideoInfoTag::Save(TiXmlNode *node, const CStdString &tag, bool savePathIn
   XMLUtils::SetString(movie, "id", m_strIMDBNumber);
   XMLUtils::SetAdditiveString(movie, "genre",
                           g_advancedSettings.m_videoItemSeparator, m_strGenre);
+  XMLUtils::SetAdditiveString(movie, "country",
+                          g_advancedSettings.m_videoItemSeparator, m_strCountry);
   XMLUtils::SetAdditiveString(movie, "set",
                           g_advancedSettings.m_videoItemSeparator, m_strSet);
   XMLUtils::SetAdditiveString(movie, "credits",
@@ -248,6 +251,7 @@ void CVideoInfoTag::Serialize(CArchive& ar)
     ar << m_strDirector;
     ar << m_strWritingCredits;
     ar << m_strGenre;
+    ar << m_strCountry;
     ar << m_strTagLine;
     ar << m_strPlotOutline;
     ar << m_strPlot;
@@ -305,6 +309,7 @@ void CVideoInfoTag::Serialize(CArchive& ar)
     ar >> m_strDirector;
     ar >> m_strWritingCredits;
     ar >> m_strGenre;
+    ar >> m_strCountry;
     ar >> m_strTagLine;
     ar >> m_strPlotOutline;
     ar >> m_strPlot;
@@ -435,6 +440,7 @@ void CVideoInfoTag::ParseNative(const TiXmlElement* movie)
   }
 
   XMLUtils::GetAdditiveString(movie,"genre",g_advancedSettings.m_videoItemSeparator,m_strGenre);
+  XMLUtils::GetAdditiveString(movie,"country",g_advancedSettings.m_videoItemSeparator,m_strCountry);
   XMLUtils::GetAdditiveString(movie,"credits",g_advancedSettings.m_videoItemSeparator,m_strWritingCredits);
   XMLUtils::GetAdditiveString(movie,"director",g_advancedSettings.m_videoItemSeparator,m_strDirector);
   XMLUtils::GetAdditiveString(movie,"showlink",g_advancedSettings.m_videoItemSeparator,m_strShowLink);
@@ -596,6 +602,21 @@ void CVideoInfoTag::ParseMyMovies(const TiXmlElement *movie)
     }
     genre = genre->NextSiblingElement("Genre");
   }
+  // countries
+  node = movie->FirstChild("Countries");
+  const TiXmlNode *country = node ? node->FirstChildElement("Country") : NULL;
+  while (country)
+  {
+    if (country && country->FirstChild())
+    {
+      strTemp = country->FirstChild()->Value();
+      if (m_strCountry.IsEmpty())
+        m_strCountry = strTemp;
+      else
+        m_strCountry += g_advancedSettings.m_videoItemSeparator+strTemp;
+    }
+    country = country->NextSibling("Countries");
+  }
   // MyMovies categories to genres
   if (g_advancedSettings.m_bVideoLibraryMyMoviesCategoriesToGenres)
   {
index 794a900..dc5b794 100644 (file)
@@ -52,6 +52,7 @@ public:
   CStdString m_strDirector;
   CStdString m_strWritingCredits;
   CStdString m_strGenre;
+  CStdString m_strCountry;
   CStdString m_strTagLine;
   CStdString m_strPlotOutline;
   CStdString m_strTrailer;
index d99f1ff..4b707b3 100644 (file)
@@ -516,6 +516,7 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition)
   {
     if (strTest.Equals("videoplayer.title")) ret = VIDEOPLAYER_TITLE;
     else if (strTest.Equals("videoplayer.genre")) ret = VIDEOPLAYER_GENRE;
+    else if (strTest.Equals("videoplayer.country")) ret = VIDEOPLAYER_COUNTRY;
     else if (strTest.Equals("videoplayer.originaltitle")) ret = VIDEOPLAYER_ORIGINALTITLE;
     else if (strTest.Equals("videoplayer.director")) ret = VIDEOPLAYER_DIRECTOR;
     else if (strTest.Equals("videoplayer.year")) ret = VIDEOPLAYER_YEAR;
@@ -899,6 +900,7 @@ int CGUIInfoManager::TranslateListItem(const CStdString &info)
   else if (info.Equals("pictureresolution")) return LISTITEM_PICTURE_RESOLUTION;
   else if (info.Equals("picturedatetime")) return LISTITEM_PICTURE_DATETIME;
   else if (info.Equals("studio")) return LISTITEM_STUDIO;
+  else if (info.Equals("country")) return LISTITEM_COUNTRY;
   else if (info.Equals("mpaa")) return LISTITEM_MPAA;
   else if (info.Equals("cast")) return LISTITEM_CAST;
   else if (info.Equals("castandrole")) return LISTITEM_CAST_AND_ROLE;
@@ -1113,6 +1115,7 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow)
   case VIDEOPLAYER_TVSHOW:
   case VIDEOPLAYER_PREMIERED:
   case VIDEOPLAYER_STUDIO:
+  case VIDEOPLAYER_COUNTRY:
   case VIDEOPLAYER_MPAA:
   case VIDEOPLAYER_TOP250:
   case VIDEOPLAYER_CAST:
@@ -3111,6 +3114,8 @@ CStdString CGUIInfoManager::GetVideoLabel(int item)
 
     case VIDEOPLAYER_STUDIO:
       return m_currentFile->GetVideoInfoTag()->m_strStudio;
+    case VIDEOPLAYER_COUNTRY:
+      return m_currentFile->GetVideoInfoTag()->m_strCountry;
     case VIDEOPLAYER_MPAA:
       return m_currentFile->GetVideoInfoTag()->m_strMPAARating;
     case VIDEOPLAYER_TOP250:
@@ -3873,6 +3878,10 @@ CStdString CGUIInfoManager::GetItemLabel(const CFileItem *item, int info) const
     if (item->HasVideoInfoTag())
       return item->GetVideoInfoTag()->m_strStudio;
     break;
+  case LISTITEM_COUNTRY:
+    if (item->HasVideoInfoTag())
+      return item->GetVideoInfoTag()->m_strCountry;
+    break;
   case LISTITEM_MPAA:
     if (item->HasVideoInfoTag())
       return item->GetVideoInfoTag()->m_strMPAARating;
index 83a2892..21ce7ec 100644 (file)
@@ -249,6 +249,7 @@ class CDateTime;
 #define VIDEOPLAYER_AUDIO_CHANNELS    289
 #define VIDEOPLAYER_VIDEO_ASPECT      290
 #define VIDEOPLAYER_HASTELETEXT       291
+#define VIDEOPLAYER_COUNTRY           292
 
 #define AUDIOSCROBBLER_ENABLED      300
 #define AUDIOSCROBBLER_CONN_STATE   301
@@ -486,6 +487,7 @@ class CDateTime;
 #define LISTITEM_SUBTITLE_LANGUAGE  (LISTITEM_START + 52)
 #define LISTITEM_IS_FOLDER          (LISTITEM_START + 53)
 #define LISTITEM_ORIGINALTITLE      (LISTITEM_START + 54)
+#define LISTITEM_COUNTRY            (LISTITEM_START + 55)
 
 #define LISTITEM_PROPERTY_START     (LISTITEM_START + 200)
 #define LISTITEM_PROPERTY_END       (LISTITEM_PROPERTY_START + 1000)