Skip to content

Commit

Permalink
Added: Support for detecting the recording type (TV, Radio, webstream)
Browse files Browse the repository at this point in the history
Added to support Kodi PVR API 5.1.0
  • Loading branch information
margro committed Nov 6, 2016
1 parent 031c291 commit b09c2cd
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
5 changes: 4 additions & 1 deletion TVServerKodi/Changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
1.15.0.136:
- Added: Support for detecting the recording type (TV, Radio, webstream)

1.15.0.135:
- Added: IPv6 support
- Added: IPv6 support (Vista and above)

1.15.0.134:
- Updated: referenced assemblies for TVServer 1.15.0 (final)
Expand Down
4 changes: 2 additions & 2 deletions TVServerKodi/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("1.15.0.135")]
[assembly: AssemblyFileVersion("1.15.0.135")]
[assembly: AssemblyVersion("1.15.0.136")]
[assembly: AssemblyFileVersion("1.15.0.136")]

// Set usage and compatibility information to MediaPortal v1.3.0 beta and above
[assembly: CompatibleVersion("1.9.100.0", "1.5.0.0")]
Expand Down
23 changes: 21 additions & 2 deletions TVServerKodi/TV/ServerInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,8 @@ public List<String> GetRecordings(bool resolveHostnames, ref string OriginalURL)
{
string recording;
string channelname;
ChannelType channelType = TvDatabase.ChannelType.Tv;

string rtspURL = GetRecordingURL(rec.IdRecording, server, resolveHostnames, ref OriginalURL);//server.GetStreamUrlForFileName(rec.IdRecording);

//XBMC pvr side:
Expand Down Expand Up @@ -1112,10 +1114,26 @@ public List<String> GetRecordings(bool resolveHostnames, ref string OriginalURL)
//[18] isrecording (bool)
//[19] timesWatched (int)
//[20] stopTime (int)
//[21] channelType (int)

try
{
channelname = rec.ReferencedChannel().DisplayName;
Channel recChannel = rec.ReferencedChannel();
channelname = recChannel.DisplayName;
if (recChannel.IsRadio)
{
channelType = TvDatabase.ChannelType.Radio;
}
else if (recChannel.IsWebstream())
{
channelType = TvDatabase.ChannelType.Web;
}
else
{
// Assume Tv for all other cases
channelType = TvDatabase.ChannelType.Tv;
}

}
catch
{ // Occurs for example when a recording is pointing to a channel
Expand Down Expand Up @@ -1151,7 +1169,8 @@ public List<String> GetRecordings(bool resolveHostnames, ref string OriginalURL)
+ rec.IdChannel.ToString() + "|" // 17
+ rec.IsRecording.ToString() + "|" // 18
+ rec.TimesWatched.ToString() + "|" // 19
+ rec.StopTime.ToString(); // 20
+ rec.StopTime.ToString() +"|" // 20
+ (int)channelType;

reclist.Add(recording);
}
Expand Down

0 comments on commit b09c2cd

Please sign in to comment.