Fix warnings in MediaBrowser.Controller

This commit is contained in:
Rich Lander
2021-08-13 20:34:36 -07:00
parent 04571e93f8
commit e3df4dcaae
22 changed files with 933 additions and 888 deletions

View File

@@ -31,24 +31,18 @@ namespace MediaBrowser.Controller.Playlists
".zpl"
};
public Guid OwnerUserId { get; set; }
public Share[] Shares { get; set; }
public Playlist()
{
Shares = Array.Empty<Share>();
}
public Guid OwnerUserId { get; set; }
public Share[] Shares { get; set; }
[JsonIgnore]
public bool IsFile => IsPlaylistFile(Path);
public static bool IsPlaylistFile(string path)
{
// The path will sometimes be a directory and "Path.HasExtension" returns true if the name contains a '.' (dot).
return System.IO.Path.HasExtension(path) && !Directory.Exists(path);
}
[JsonIgnore]
public override string ContainingFolderPath
{
@@ -80,6 +74,41 @@ namespace MediaBrowser.Controller.Playlists
[JsonIgnore]
public override bool SupportsCumulativeRunTimeTicks => true;
[JsonIgnore]
public override bool IsPreSorted => true;
public string PlaylistMediaType { get; set; }
[JsonIgnore]
public override string MediaType => PlaylistMediaType;
[JsonIgnore]
private bool IsSharedItem
{
get
{
var path = Path;
if (string.IsNullOrEmpty(path))
{
return false;
}
return FileSystem.ContainsSubPath(ConfigurationManager.ApplicationPaths.DataPath, path);
}
}
public static bool IsPlaylistFile(string path)
{
// The path will sometimes be a directory and "Path.HasExtension" returns true if the name contains a '.' (dot).
return System.IO.Path.HasExtension(path) && !Directory.Exists(path);
}
public void SetMediaType(string value)
{
PlaylistMediaType = value;
}
public override double GetDefaultPrimaryImageAspectRatio()
{
return 1;
@@ -197,35 +226,6 @@ namespace MediaBrowser.Controller.Playlists
return new[] { item };
}
[JsonIgnore]
public override bool IsPreSorted => true;
public string PlaylistMediaType { get; set; }
[JsonIgnore]
public override string MediaType => PlaylistMediaType;
public void SetMediaType(string value)
{
PlaylistMediaType = value;
}
[JsonIgnore]
private bool IsSharedItem
{
get
{
var path = Path;
if (string.IsNullOrEmpty(path))
{
return false;
}
return FileSystem.ContainsSubPath(ConfigurationManager.ApplicationPaths.DataPath, path);
}
}
public override bool IsVisible(User user)
{
if (!IsSharedItem)