Permalink
Browse files

Merge pull request #1400 from Montellese/video_tags

Tagging support for tvshows and musicvideos
  • Loading branch information...
2 parents d748cb5 + 21ee391 commit 9f0b31ca1c4b31e133a2df4aa11e01c03a46e07d @Montellese Montellese committed Sep 10, 2012
@@ -0,0 +1,5 @@
+<node order="8" type="folder">
+ <label>20459</label>
+ <path>videodb://3/9</path>
+ <icon>DefaultTags.png</icon>
+</node>
@@ -0,0 +1,5 @@
+<node order="6" type="folder">
+ <label>20459</label>
+ <path>videodb://2/9</path>
+ <icon>DefaultTags.png</icon>
+</node>
@@ -33,6 +33,7 @@ Node MusicVideoChildren[] = {
{ NODE_TYPE_MUSICVIDEOS_ALBUM, 5, 132 },
{ NODE_TYPE_DIRECTOR, 6, 20348 },
{ NODE_TYPE_STUDIO, 7, 20388 },
+ { NODE_TYPE_TAGS, 9, 20459 }
};
CDirectoryNodeMusicVideosOverview::CDirectoryNodeMusicVideosOverview(const CStdString& strName, CDirectoryNode* pParent)
@@ -32,7 +32,14 @@ CDirectoryNodeTags::CDirectoryNodeTags(const CStdString& strName, CDirectoryNode
NODE_TYPE CDirectoryNodeTags::GetChildType() const
{
- return NODE_TYPE_TITLE_MOVIES;
+ CQueryParams params;
+ CollectQueryParams(params);
+ if (params.GetContentType() == VIDEODB_CONTENT_MOVIES)
+ return NODE_TYPE_TITLE_MOVIES;
+ if (params.GetContentType() == VIDEODB_CONTENT_MUSICVIDEOS)
+ return NODE_TYPE_TITLE_MUSICVIDEOS;
+
+ return NODE_TYPE_TITLE_TVSHOWS;
}
CStdString CDirectoryNodeTags::GetLocalizedName() const
@@ -39,7 +39,7 @@ bool CDirectoryNodeTitleMusicVideos::GetContent(CFileItemList& items) const
CQueryParams params;
CollectQueryParams(params);
- bool bSuccess=videodatabase.GetMusicVideosNav(BuildPath(), items, params.GetGenreId(), params.GetYear(), params.GetActorId(), params.GetDirectorId(),params.GetStudioId(),params.GetAlbumId());
+ bool bSuccess=videodatabase.GetMusicVideosNav(BuildPath(), items, params.GetGenreId(), params.GetYear(), params.GetActorId(), params.GetDirectorId(), params.GetStudioId(), params.GetAlbumId(), params.GetTagId());
videodatabase.Close();
@@ -52,7 +52,7 @@ bool CDirectoryNodeTitleTvShows::GetContent(CFileItemList& items) const
CQueryParams params;
CollectQueryParams(params);
- bool bSuccess=videodatabase.GetTvShowsNav(BuildPath(), items, params.GetGenreId(), params.GetYear(), params.GetActorId(), params.GetDirectorId(), params.GetStudioId());
+ bool bSuccess=videodatabase.GetTvShowsNav(BuildPath(), items, params.GetGenreId(), params.GetYear(), params.GetActorId(), params.GetDirectorId(), params.GetStudioId(), params.GetTagId());
videodatabase.Close();
@@ -31,6 +31,7 @@ Node TvShowChildren[] = {
{ NODE_TYPE_YEAR, 3, 562 },
{ NODE_TYPE_ACTOR, 4, 344 },
{ NODE_TYPE_STUDIO, 5, 20388 },
+ { NODE_TYPE_TAGS, 9, 20459 }
};
CDirectoryNodeTvShowsOverview::CDirectoryNodeTvShowsOverview(const CStdString& strName, CDirectoryNode* pParent)
@@ -454,7 +454,7 @@ namespace JSONRPC
"\"imdbnumber\", \"premiered\", \"votes\", \"lastplayed\","
"\"fanart\", \"thumbnail\", \"file\", \"originaltitle\","
"\"sorttitle\", \"episodeguide\", \"season\", \"watchedepisodes\","
- "\"dateadded\"]"
+ "\"dateadded\", \"tag\" ]"
"}"
"}",
"\"Video.Fields.Season\": {"
@@ -482,7 +482,7 @@ namespace JSONRPC
"\"enum\": [ \"title\", \"playcount\", \"runtime\", \"director\","
"\"studio\", \"year\", \"plot\", \"album\", \"artist\","
"\"genre\", \"track\", \"streamdetails\", \"lastplayed\","
- "\"fanart\", \"thumbnail\", \"file\", \"resume\", \"dateadded\" ]"
+ "\"fanart\", \"thumbnail\", \"file\", \"resume\", \"dateadded\", \"tag\" ]"
"}"
"}",
"\"Video.Cast\": {"
@@ -628,7 +628,8 @@ namespace JSONRPC
"\"premiered\": { \"type\": \"string\" },"
"\"votes\": { \"type\": \"string\" },"
"\"episodeguide\": { \"type\": \"string\" },"
- "\"season\": { \"type\": \"integer\" }"
+ "\"season\": { \"type\": \"integer\" },"
+ "\"tag\": { \"$ref\": \"Array.String\" }"
"}"
"}",
"\"Video.Details.Season\": {"
@@ -667,7 +668,8 @@ namespace JSONRPC
"\"album\": { \"type\": \"string\" },"
"\"artist\": { \"$ref\": \"Array.String\" },"
"\"genre\": { \"$ref\": \"Array.String\" },"
- "\"track\": { \"type\": \"integer\" }"
+ "\"track\": { \"type\": \"integer\" },"
+ "\"tag\": { \"$ref\": \"Array.String\" }"
"}"
"}",
"\"Files.Media\": {"
@@ -1381,7 +1383,7 @@ namespace JSONRPC
"\"transport\": \"Response\","
"\"permission\": \"ControlPlayback\","
"\"params\": ["
- "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true },"
+ "{ \"name\": \"playerid\", \"$ref\": \"Player.Id\", \"required\": true }"
"{ \"name\": \"value\", \"type\": \"string\", \"enum\": [ \"clockwise\", \"counterclockwise\" ], \"default\": \"clockwise\" }"
"],"
"\"returns\": \"string\""
@@ -2115,6 +2117,7 @@ namespace JSONRPC
"{ \"type\": \"object\", \"properties\": { \"year\": { \"type\": \"integer\", \"minimum\": 0, \"required\": true } }, \"additionalProperties\": false },"
"{ \"type\": \"object\", \"properties\": { \"actor\": { \"type\": \"string\", \"minLength\": 1, \"required\": true } }, \"additionalProperties\": false },"
"{ \"type\": \"object\", \"properties\": { \"studio\": { \"type\": \"string\", \"minLength\": 1, \"required\": true } }, \"additionalProperties\": false },"
+ "{ \"type\": \"object\", \"properties\": { \"tag\": { \"type\": \"string\", \"minLength\": 1, \"required\": true } }, \"additionalProperties\": false },"
"{ \"$ref\": \"List.Filter.TVShows\" }"
"]"
"}"
@@ -2226,6 +2229,7 @@ namespace JSONRPC
"{ \"type\": \"object\", \"properties\": { \"year\": { \"type\": \"integer\", \"minimum\": 0, \"required\": true } }, \"additionalProperties\": false },"
"{ \"type\": \"object\", \"properties\": { \"director\": { \"type\": \"string\", \"minLength\": 1, \"required\": true } }, \"additionalProperties\": false },"
"{ \"type\": \"object\", \"properties\": { \"studio\": { \"type\": \"string\", \"minLength\": 1, \"required\": true } }, \"additionalProperties\": false },"
+ "{ \"type\": \"object\", \"properties\": { \"tag\": { \"type\": \"string\", \"minLength\": 1, \"required\": true } }, \"additionalProperties\": false },"
"{ \"$ref\": \"List.Filter.MusicVideos\" }"
"]"
"}"
@@ -2390,7 +2394,8 @@ namespace JSONRPC
"{ \"name\": \"sorttitle\", \"$ref\": \"Optional.String\" },"
"{ \"name\": \"episodeguide\", \"$ref\": \"Optional.String\" },"
"{ \"name\": \"thumbnail\", \"$ref\": \"Optional.String\" },"
- "{ \"name\": \"fanart\", \"$ref\": \"Optional.String\" }"
+ "{ \"name\": \"fanart\", \"$ref\": \"Optional.String\" },"
+ "{ \"name\": \"tag\", \"type\": [ \"null\", { \"$ref\": \"Array.String\", \"required\": true } ], \"default\": null }"
"],"
"\"returns\": \"string\""
"}",
@@ -2440,7 +2445,8 @@ namespace JSONRPC
"{ \"name\": \"track\", \"$ref\": \"Optional.Integer\" },"
"{ \"name\": \"lastplayed\", \"$ref\": \"Optional.String\" },"
"{ \"name\": \"thumbnail\", \"$ref\": \"Optional.String\" },"
- "{ \"name\": \"fanart\", \"$ref\": \"Optional.String\" }"
+ "{ \"name\": \"fanart\", \"$ref\": \"Optional.String\" },"
+ "{ \"name\": \"tag\", \"type\": [ \"null\", { \"$ref\": \"Array.String\", \"required\": true } ], \"default\": null }"
"],"
"\"returns\": \"string\""
"}",
@@ -169,6 +169,8 @@ JSONRPC_STATUS CVideoLibrary::GetTVShows(const CStdString &method, ITransportLay
videoUrl.AddOption("actor", filter["actor"].asString());
else if (filter.isMember("studio"))
videoUrl.AddOption("studio", filter["studio"].asString());
+ else if (filter.isMember("tag"))
+ videoUrl.AddOption("tag", filter["tag"].asString());
else if (filter.isObject())
{
CStdString xsp;
@@ -179,14 +181,14 @@ JSONRPC_STATUS CVideoLibrary::GetTVShows(const CStdString &method, ITransportLay
}
CFileItemList items;
- if (!videodatabase.GetTvShowsNav(videoUrl.ToString(), items, genreID, year, -1, -1, -1, sorting))
+ if (!videodatabase.GetTvShowsNav(videoUrl.ToString(), items, genreID, year, -1, -1, -1, -1, sorting))
return InvalidParams;
bool additionalInfo = false;
for (CVariant::const_iterator_array itr = parameterObject["properties"].begin_array(); itr != parameterObject["properties"].end_array(); itr++)
{
CStdString fieldValue = itr->asString();
- if (fieldValue == "cast")
+ if (fieldValue == "cast" || fieldValue == "tag")
additionalInfo = true;
}
@@ -350,6 +352,8 @@ JSONRPC_STATUS CVideoLibrary::GetMusicVideos(const CStdString &method, ITranspor
videoUrl.AddOption("director", filter["director"].asString());
else if (filter.isMember("studio"))
videoUrl.AddOption("studio", filter["studio"].asString());
+ else if (filter.isMember("tag"))
+ videoUrl.AddOption("tag", filter["tag"].asString());
else if (filter.isObject())
{
CStdString xsp;
@@ -360,7 +364,7 @@ JSONRPC_STATUS CVideoLibrary::GetMusicVideos(const CStdString &method, ITranspor
}
CFileItemList items;
- if (!videodatabase.GetMusicVideosNav(videoUrl.ToString(), items, genreID, year, -1, -1, -1, -1, sorting))
+ if (!videodatabase.GetMusicVideosNav(videoUrl.ToString(), items, genreID, year, -1, -1, -1, -1, -1, sorting))
return InternalError;
return GetAdditionalMusicVideoDetails(parameterObject, items, result, videodatabase, false);
@@ -1051,6 +1051,7 @@
{ "type": "object", "properties": { "year": { "type": "integer", "minimum": 0, "required": true } }, "additionalProperties": false },
{ "type": "object", "properties": { "actor": { "type": "string", "minLength": 1, "required": true } }, "additionalProperties": false },
{ "type": "object", "properties": { "studio": { "type": "string", "minLength": 1, "required": true } }, "additionalProperties": false },
+ { "type": "object", "properties": { "tag": { "type": "string", "minLength": 1, "required": true } }, "additionalProperties": false },
{ "$ref": "List.Filter.TVShows" }
]
}
@@ -1162,6 +1163,7 @@
{ "type": "object", "properties": { "year": { "type": "integer", "minimum": 0, "required": true } }, "additionalProperties": false },
{ "type": "object", "properties": { "director": { "type": "string", "minLength": 1, "required": true } }, "additionalProperties": false },
{ "type": "object", "properties": { "studio": { "type": "string", "minLength": 1, "required": true } }, "additionalProperties": false },
+ { "type": "object", "properties": { "tag": { "type": "string", "minLength": 1, "required": true } }, "additionalProperties": false },
{ "$ref": "List.Filter.MusicVideos" }
]
}
@@ -1326,7 +1328,8 @@
{ "name": "sorttitle", "$ref": "Optional.String" },
{ "name": "episodeguide", "$ref": "Optional.String" },
{ "name": "thumbnail", "$ref": "Optional.String" },
- { "name": "fanart", "$ref": "Optional.String" }
+ { "name": "fanart", "$ref": "Optional.String" },
+ { "name": "tag", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }
],
"returns": "string"
},
@@ -1376,7 +1379,8 @@
{ "name": "track", "$ref": "Optional.Integer" },
{ "name": "lastplayed", "$ref": "Optional.String" },
{ "name": "thumbnail", "$ref": "Optional.String" },
- { "name": "fanart", "$ref": "Optional.String" }
+ { "name": "fanart", "$ref": "Optional.String" },
+ { "name": "tag", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }
],
"returns": "string"
},
@@ -427,7 +427,7 @@
"imdbnumber", "premiered", "votes", "lastplayed",
"fanart", "thumbnail", "file", "originaltitle",
"sorttitle", "episodeguide", "season", "watchedepisodes",
- "dateadded"]
+ "dateadded", "tag" ]
}
},
"Video.Fields.Season": {
@@ -455,7 +455,7 @@
"enum": [ "title", "playcount", "runtime", "director",
"studio", "year", "plot", "album", "artist",
"genre", "track", "streamdetails", "lastplayed",
- "fanart", "thumbnail", "file", "resume", "dateadded" ]
+ "fanart", "thumbnail", "file", "resume", "dateadded", "tag" ]
}
},
"Video.Cast": {
@@ -601,7 +601,8 @@
"premiered": { "type": "string" },
"votes": { "type": "string" },
"episodeguide": { "type": "string" },
- "season": { "type": "integer" }
+ "season": { "type": "integer" },
+ "tag": { "$ref": "Array.String" }
}
},
"Video.Details.Season": {
@@ -640,7 +641,8 @@
"album": { "type": "string" },
"artist": { "$ref": "Array.String" },
"genre": { "$ref": "Array.String" },
- "track": { "type": "integer" }
+ "track": { "type": "integer" },
+ "tag": { "$ref": "Array.String" }
}
},
"Files.Media": {
Oops, something went wrong.

0 comments on commit 9f0b31c

Please sign in to comment.