public List<RecordingInfo> getRecordings() { List<RecordingInfo> recInfos = new List<RecordingInfo>(); try { IList<TvDatabase.Recording> recordings = Recording.ListAll(); foreach (Recording rec in recordings) { RecordingInfo recInfo = new RecordingInfo(); recInfo.recordingID = rec.IdRecording.ToString(); try { recInfo.channel = rec.ReferencedChannel().DisplayName; } catch { // Occurs for example when a recording is pointing to a channel // that is deleted in the meantime recInfo.channel = rec.IdChannel.ToString(); } recInfo.title = rec.Title; recInfo.description = rec.Description; recInfo.genre = rec.Genre; recInfo.timeInfo = rec.StartTime.ToString("u") + "|" + rec.EndTime.ToString("u"); recInfos.Add(recInfo); } } catch (Exception ex) { lastException = ex; Console.WriteLine(ex.ToString()); Log.Error("TVServerXBMC: " + ex.ToString()); return null; } return recInfos; }
public List<RecordingInfo> GetRecordings() { List<RecordingInfo> recInfos = new List<RecordingInfo>(); try { IList<Recording> recordings = Recording.ListAll(); foreach (Recording rec in recordings) { RecordingInfo recInfo = new RecordingInfo(); recInfo.recordingID = rec.IdRecording.ToString(); recInfo.title = rec.Title; recInfo.description = rec.Description; recInfo.genre = rec.Genre; recInfo.timeInfo = rec.StartTime.ToString() + "-" + rec.EndTime.ToString(); recInfos.Add(recInfo); } } catch (Exception ex) { lastException = ex; return null; } return recInfos; }