mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-17 13:10:28 +01:00
Some minor code cleanups
This commit is contained in:
parent
016590529f
commit
670a53258e
@@ -26,9 +26,6 @@ namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
MediaStream stream = data.streams.First(s => s.codec_type.Equals("audio", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
string bitrate = null;
|
||||
string duration = null;
|
||||
|
||||
audio.Channels = stream.channels;
|
||||
|
||||
if (!string.IsNullOrEmpty(stream.sample_rate))
|
||||
@@ -36,8 +33,8 @@ namespace MediaBrowser.Controller.Providers
|
||||
audio.SampleRate = int.Parse(stream.sample_rate);
|
||||
}
|
||||
|
||||
bitrate = stream.bit_rate;
|
||||
duration = stream.duration;
|
||||
string bitrate = stream.bit_rate;
|
||||
string duration = stream.duration;
|
||||
|
||||
if (string.IsNullOrEmpty(bitrate))
|
||||
{
|
||||
@@ -78,7 +75,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
if (!string.IsNullOrEmpty(composer))
|
||||
{
|
||||
audio.AddPerson(new PersonInfo() { Name = composer, Type = "Composer" });
|
||||
audio.AddPerson(new PersonInfo { Name = composer, Type = "Composer" });
|
||||
}
|
||||
|
||||
audio.Album = GetDictionaryValue(tags, "album");
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
item.DisplayMediaType = VideoType.BluRay.ToString();
|
||||
break;
|
||||
case "dvd":
|
||||
item.DisplayMediaType = VideoType.DVD.ToString();
|
||||
item.DisplayMediaType = VideoType.Dvd.ToString();
|
||||
break;
|
||||
case "":
|
||||
item.DisplayMediaType = null;
|
||||
@@ -163,7 +163,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
case "Director":
|
||||
{
|
||||
foreach (PersonInfo p in GetSplitValues(reader.ReadElementContentAsString(), '|').Select(v => new PersonInfo() { Name = v, Type = "Director" }))
|
||||
foreach (PersonInfo p in GetSplitValues(reader.ReadElementContentAsString(), '|').Select(v => new PersonInfo { Name = v, Type = "Director" }))
|
||||
{
|
||||
item.AddPerson(p);
|
||||
}
|
||||
@@ -171,7 +171,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
}
|
||||
case "Writer":
|
||||
{
|
||||
foreach (PersonInfo p in GetSplitValues(reader.ReadElementContentAsString(), '|').Select(v => new PersonInfo() { Name = v, Type = "Writer" }))
|
||||
foreach (PersonInfo p in GetSplitValues(reader.ReadElementContentAsString(), '|').Select(v => new PersonInfo { Name = v, Type = "Writer" }))
|
||||
{
|
||||
item.AddPerson(p);
|
||||
}
|
||||
@@ -181,7 +181,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
case "Actors":
|
||||
case "GuestStars":
|
||||
{
|
||||
foreach (PersonInfo p in GetSplitValues(reader.ReadElementContentAsString(), '|').Select(v => new PersonInfo() { Name = v, Type = "Actor" }))
|
||||
foreach (PersonInfo p in GetSplitValues(reader.ReadElementContentAsString(), '|').Select(v => new PersonInfo { Name = v, Type = "Actor" }))
|
||||
{
|
||||
item.AddPerson(p);
|
||||
}
|
||||
|
||||
@@ -34,10 +34,8 @@ namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
return Task.Run(() => { PopulateBaseItemImages(baseItem, args); });
|
||||
}
|
||||
else
|
||||
{
|
||||
return Task.Run(() => { PopulateImages(item, args); });
|
||||
}
|
||||
|
||||
return Task.Run(() => { PopulateImages(item, args); });
|
||||
}
|
||||
|
||||
return Task.FromResult<object>(null);
|
||||
|
||||
Reference in New Issue
Block a user