Skip to content

Commit

Permalink
added: Ticket xbmc#8990 - Production country for movies, thanks to ve…
Browse files Browse the repository at this point in the history
…ntech

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@29886 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information
jmarshallnz committed May 7, 2010
1 parent 5edb0e6 commit 281d796
Show file tree
Hide file tree
Showing 30 changed files with 370 additions and 24 deletions.
8 changes: 8 additions & 0 deletions XBMC.xcodeproj/project.pbxproj
Expand Up @@ -243,6 +243,8 @@
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 */; };
Expand Down Expand Up @@ -2135,6 +2137,8 @@
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>"; };
Expand Down Expand Up @@ -5735,6 +5739,8 @@
E38E175F0D25F9FA00618676 /* VideoDatabaseDirectory */ = {
isa = PBXGroup;
children = (
7CD2C3A811940B270009EFC1 /* DirectoryNodeCountry.cpp */,
7CD2C3A911940B270009EFC1 /* DirectoryNodeCountry.h */,
E38E17600D25F9FA00618676 /* DirectoryNode.cpp */,
E38E17610D25F9FA00618676 /* DirectoryNode.h */,
E38E17620D25F9FA00618676 /* DirectoryNodeActor.cpp */,
Expand Down Expand Up @@ -8184,6 +8190,7 @@
18E9C8EE11834DF600DF8B9F /* GUIDialogAddonInfo.cpp in Sources */,
F52B063B11869862004B1D66 /* Skin.cpp in Sources */,
F52B06BA1187CE18004B1D66 /* DVDVideoCodecVDA.cpp in Sources */,
7CD2C3AB11940B270009EFC1 /* DirectoryNodeCountry.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -9054,6 +9061,7 @@
18E9C8EF11834DF600DF8B9F /* GUIDialogAddonInfo.cpp in Sources */,
F52B063C11869862004B1D66 /* Skin.cpp in Sources */,
F52B06BB1187CE18004B1D66 /* DVDVideoCodecVDA.cpp in Sources */,
7CD2C3AA11940B270009EFC1 /* DirectoryNodeCountry.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
3 changes: 3 additions & 0 deletions addons/com.imdb.scraper/imdb.xml
Expand Up @@ -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>
Expand Down
3 changes: 3 additions & 0 deletions addons/metadata.themoviedb.org/tmdb.xml
Expand Up @@ -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>
Expand Down
2 changes: 2 additions & 0 deletions language/English/strings.xml
Expand Up @@ -502,6 +502,7 @@
<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>
Expand Down Expand Up @@ -1870,6 +1871,7 @@
<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>
Expand Down
1 change: 1 addition & 0 deletions language/Norwegian/strings.xml
Expand Up @@ -493,6 +493,7 @@
<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>
Expand Down
3 changes: 3 additions & 0 deletions xbmc/FileItem.cpp
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions xbmc/FileSystem/PluginDirectory.cpp
Expand Up @@ -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"));
Expand Down
11 changes: 11 additions & 0 deletions xbmc/FileSystem/VideoDatabaseDirectory.cpp
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNode.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNode.h
Expand Up @@ -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
Expand Down
55 changes: 55 additions & 0 deletions xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeCountry.cpp
@@ -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;
}
40 changes: 40 additions & 0 deletions xbmc/FileSystem/VideoDatabaseDirectory/DirectoryNodeCountry.h
@@ -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);
};
}
}


Expand Up @@ -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;
Expand All @@ -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())
{
Expand Down
Expand Up @@ -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();

Expand Down
1 change: 1 addition & 0 deletions xbmc/FileSystem/VideoDatabaseDirectory/Makefile
Expand Up @@ -5,6 +5,7 @@ SRCS=DirectoryNodeActor.cpp \
DirectoryNodeDirector.cpp \
DirectoryNodeEpisodes.cpp \
DirectoryNodeGenre.cpp \
DirectoryNodeCountry.cpp \
DirectoryNodeSets.cpp \
DirectoryNodeMoviesOverview.cpp \
DirectoryNodeOverview.cpp \
Expand Down
4 changes: 4 additions & 0 deletions xbmc/FileSystem/VideoDatabaseDirectory/QueryParams.cpp
Expand Up @@ -27,6 +27,7 @@ CQueryParams::CQueryParams()
{
m_idMovie = -1;
m_idGenre = -1;
m_idCountry = -1;
m_idYear = -1;
m_idActor = -1;
m_idDirector = -1;
Expand All @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions xbmc/FileSystem/VideoDatabaseDirectory/QueryParams.h
Expand Up @@ -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; }
Expand All @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions xbmc/GUIDialogSmartPlaylistRule.cpp
Expand Up @@ -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"))
Expand Down
1 change: 1 addition & 0 deletions xbmc/GUIViewStateVideo.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 281d796

Please sign in to comment.