Skip to content

Commit

Permalink
jsonrpc: add "lastplayed" property for songs (closes #12943)
Browse files Browse the repository at this point in the history
  • Loading branch information
Montellese committed Apr 21, 2012
1 parent 8d73c5d commit 601ad77
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions xbmc/interfaces/json-rpc/ServiceDescription.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ namespace JSONRPC
"\"lyrics\", \"musicbrainztrackid\", \"musicbrainzartistid\","
"\"musicbrainzalbumid\", \"musicbrainzalbumartistid\","
"\"playcount\", \"fanart\", \"thumbnail\", \"file\", \"artistid\","
"\"albumid\" ]"
"\"albumid\", \"lastplayed\" ]"
"}"
"}",
"\"Audio.Details.Base\": {"
Expand Down Expand Up @@ -411,7 +411,8 @@ namespace JSONRPC
"\"musicbrainztrackid\": { \"type\": \"string\" },"
"\"musicbrainzartistid\": { \"type\": \"string\" },"
"\"artistid\": { \"$ref\": \"Library.Id\" },"
"\"albumid\": { \"$ref\": \"Library.Id\" }"
"\"albumid\": { \"$ref\": \"Library.Id\" },"
"\"lastplayed\": { \"type\": \"string\" }"
"}"
"}",
"\"Video.Fields.Movie\": {"
Expand Down
5 changes: 3 additions & 2 deletions xbmc/interfaces/json-rpc/types.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
"lyrics", "musicbrainztrackid", "musicbrainzartistid",
"musicbrainzalbumid", "musicbrainzalbumartistid",
"playcount", "fanart", "thumbnail", "file", "artistid",
"albumid" ]
"albumid", "lastplayed" ]
}
},
"Audio.Details.Base": {
Expand Down Expand Up @@ -383,7 +383,8 @@
"musicbrainztrackid": { "type": "string" },
"musicbrainzartistid": { "type": "string" },
"artistid": { "$ref": "Library.Id" },
"albumid": { "$ref": "Library.Id" }
"albumid": { "$ref": "Library.Id" },
"lastplayed": { "type": "string" }
}
},
"Video.Fields.Movie": {
Expand Down
1 change: 1 addition & 0 deletions xbmc/music/Song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ void CSong::Serialize(CVariant& value)
value["comment"] = strComment;
value["rating"] = rating;
value["timesplayed"] = iTimesPlayed;
value["lastplayed"] = lastPlayed.IsValid() ? lastPlayed.GetAsDBDateTime() : "";
value["karaokenumber"] = (int64_t) iKaraokeNumber;
value["artistid"] = iArtistId;
value["albumid"] = iAlbumId;
Expand Down
1 change: 1 addition & 0 deletions xbmc/music/tags/MusicInfoTag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ void CMusicInfoTag::Serialize(CVariant& value)
value["comment"] = m_strComment;
value["rating"] = m_rating;
value["playcount"] = m_iTimesPlayed;
value["lastplayed"] = m_lastPlayed.IsValid() ? m_lastPlayed.GetAsDBDateTime() : StringUtils::EmptyString;
value["lyrics"] = m_strLyrics;
value["artistid"] = m_iArtistId;
value["albumid"] = m_iAlbumId;
Expand Down

0 comments on commit 601ad77

Please sign in to comment.