Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

json-rpc: add "albumartistid" property for songs

  • Loading branch information...
commit a8c055c723ce565adf7c7802dd1d6115684d24a4 1 parent 7a51202
@Montellese Montellese authored
View
13 xbmc/interfaces/json-rpc/AudioLibrary.cpp
@@ -703,6 +703,7 @@ JSONRPC_STATUS CAudioLibrary::GetAdditionalSongDetails(const CVariant &parameter
std::set<std::string> checkProperties;
checkProperties.insert("genreid");
checkProperties.insert("artistid");
+ checkProperties.insert("albumartistid");
std::set<std::string> additionalProperties;
if (!CheckForAdditionalProperties(parameterObject["properties"], checkProperties, additionalProperties))
return OK;
@@ -734,6 +735,18 @@ JSONRPC_STATUS CAudioLibrary::GetAdditionalSongDetails(const CVariant &parameter
item->SetProperty("artistid", artistidObj);
}
}
+ if (additionalProperties.find("albumartistid") != additionalProperties.end() && item->GetMusicInfoTag()->GetAlbumId() > 0)
+ {
+ std::vector<int> albumartistids;
+ if (musicdatabase.GetArtistsByAlbum(item->GetMusicInfoTag()->GetAlbumId(), true, albumartistids))
+ {
+ CVariant albumartistidObj(CVariant::VariantTypeArray);
+ for (std::vector<int>::const_iterator albumartistid = albumartistids.begin(); albumartistid != albumartistids.end(); albumartistid++)
+ albumartistidObj.push_back(*albumartistid);
+
+ item->SetProperty("albumartistid", albumartistidObj);
+ }
+ }
}
return OK;
View
16 xbmc/interfaces/json-rpc/ServiceDescription.h
@@ -430,13 +430,14 @@ namespace JSONRPC
"\"Audio.Fields.Song\": {"
"\"extends\": \"Item.Fields.Base\","
"\"items\": { \"type\": \"string\","
- "\"description\": \"Requesting the genreid and/or artistid field will result in increased response times\","
+ "\"description\": \"Requesting the genreid, artistid and/or albumartistid field will result in increased response times\","
"\"enum\": [ \"title\", \"artist\", \"albumartist\", \"genre\", \"year\","
"\"rating\", \"album\", \"track\", \"duration\", \"comment\","
"\"lyrics\", \"musicbrainztrackid\", \"musicbrainzartistid\","
"\"musicbrainzalbumid\", \"musicbrainzalbumartistid\","
"\"playcount\", \"fanart\", \"thumbnail\", \"file\", \"albumid\","
- "\"lastplayed\", \"disc\", \"genreid\", \"artistid\", \"displayartist\" ]"
+ "\"lastplayed\", \"disc\", \"genreid\", \"artistid\", \"displayartist\","
+ "\"albumartistid\" ]"
"}"
"}",
"\"Audio.Details.Base\": {"
@@ -505,7 +506,8 @@ namespace JSONRPC
"\"musicbrainzartistid\": { \"type\": \"string\" },"
"\"albumid\": { \"$ref\": \"Library.Id\" },"
"\"lastplayed\": { \"type\": \"string\" },"
- "\"disc\": { \"type\": \"integer\" }"
+ "\"disc\": { \"type\": \"integer\" },"
+ "\"albumartistid\": { \"$ref\": \"Array.Integer\" }"
"}"
"}",
"\"Video.Fields.Movie\": {"
@@ -1048,7 +1050,8 @@ namespace JSONRPC
"\"tvshowid\": { \"$ref\": \"Library.Id\" },"
"\"watchedepisodes\": { \"type\": \"integer\" },"
"\"disc\": { \"type\": \"integer\" },"
- "\"tag\": { \"$ref\": \"Array.String\" }"
+ "\"tag\": { \"$ref\": \"Array.String\" },"
+ "\"albumartistid\": { \"$ref\": \"Array.Integer\" }"
"}"
"}",
"\"List.Fields.All\": {"
@@ -1064,7 +1067,8 @@ namespace JSONRPC
"\"firstaired\", \"season\", \"episode\", \"showtitle\", \"thumbnail\", \"file\","
"\"resume\", \"artistid\", \"albumid\", \"tvshowid\", \"setid\", \"watchedepisodes\","
"\"disc\", \"tag\", \"art\", \"channel\", \"channeltype\", \"hidden\", \"locked\","
- "\"channelnumber\", \"starttime\", \"endtime\", \"genreid\", \"displayartist\" ]"
+ "\"channelnumber\", \"starttime\", \"endtime\", \"genreid\", \"displayartist\","
+ "\"albumartistid\" ]"
"}"
"}",
"\"List.Item.All\": {"
@@ -1092,7 +1096,7 @@ namespace JSONRPC
"\"firstaired\", \"season\", \"episode\", \"showtitle\", \"thumbnail\", \"file\","
"\"resume\", \"artistid\", \"albumid\", \"tvshowid\", \"setid\", \"watchedepisodes\","
"\"disc\", \"tag\", \"art\", \"size\", \"lastmodified\", \"mimetype\", \"genreid\","
- "\"displayartist\" ]"
+ "\"displayartist\", \"albumartistid\" ]"
"}"
"}",
"\"List.Item.File\": {"
View
16 xbmc/interfaces/json-rpc/types.json
@@ -403,13 +403,14 @@
"Audio.Fields.Song": {
"extends": "Item.Fields.Base",
"items": { "type": "string",
- "description": "Requesting the genreid and/or artistid field will result in increased response times",
+ "description": "Requesting the genreid, artistid and/or albumartistid field will result in increased response times",
"enum": [ "title", "artist", "albumartist", "genre", "year",
"rating", "album", "track", "duration", "comment",
"lyrics", "musicbrainztrackid", "musicbrainzartistid",
"musicbrainzalbumid", "musicbrainzalbumartistid",
"playcount", "fanart", "thumbnail", "file", "albumid",
- "lastplayed", "disc", "genreid", "artistid", "displayartist" ]
+ "lastplayed", "disc", "genreid", "artistid", "displayartist",
+ "albumartistid" ]
}
},
"Audio.Details.Base": {
@@ -478,7 +479,8 @@
"musicbrainzartistid": { "type": "string" },
"albumid": { "$ref": "Library.Id" },
"lastplayed": { "type": "string" },
- "disc": { "type": "integer" }
+ "disc": { "type": "integer" },
+ "albumartistid": { "$ref": "Array.Integer" }
}
},
"Video.Fields.Movie": {
@@ -1021,7 +1023,8 @@
"tvshowid": { "$ref": "Library.Id" },
"watchedepisodes": { "type": "integer" },
"disc": { "type": "integer" },
- "tag": { "$ref": "Array.String" }
+ "tag": { "$ref": "Array.String" },
+ "albumartistid": { "$ref": "Array.Integer" }
}
},
"List.Fields.All": {
@@ -1037,7 +1040,8 @@
"firstaired", "season", "episode", "showtitle", "thumbnail", "file",
"resume", "artistid", "albumid", "tvshowid", "setid", "watchedepisodes",
"disc", "tag", "art", "channel", "channeltype", "hidden", "locked",
- "channelnumber", "starttime", "endtime", "genreid", "displayartist" ]
+ "channelnumber", "starttime", "endtime", "genreid", "displayartist",
+ "albumartistid" ]
}
},
"List.Item.All": {
@@ -1065,7 +1069,7 @@
"firstaired", "season", "episode", "showtitle", "thumbnail", "file",
"resume", "artistid", "albumid", "tvshowid", "setid", "watchedepisodes",
"disc", "tag", "art", "size", "lastmodified", "mimetype", "genreid",
- "displayartist" ]
+ "displayartist", "albumartistid" ]
}
},
"List.Item.File": {
Please sign in to comment.
Something went wrong with that request. Please try again.