mirror of https://github.com/jellyfin/jellyfin.git
Apply suggestions from code review
Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
This commit is contained in:
parent
ae22d0b7a5
commit
56e135f5e6
|
@ -476,14 +476,10 @@ namespace Jellyfin.Api.Helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback to the container of mediaSource
|
// Fallback to the container of mediaSource
|
||||||
if (mediaSource != null && !string.IsNullOrEmpty(mediaSource.Container))
|
if (!string.IsNullOrEmpty(mediaSource?.Container))
|
||||||
{
|
{
|
||||||
var containers = mediaSource.Container.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
var idx = mediaSource.Container.IndexOf(',', StringComparison.OrdinalIgnoreCase);
|
||||||
|
return '.' + (idx == -1 ? mediaSource.Container : mediaSource.Container[..idx]).Trim();
|
||||||
if (containers.Length > 0)
|
|
||||||
{
|
|
||||||
return '.' + containers[0];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in New Issue