chore: fix more warnings.
This commit is contained in:
parent
12d98c46cb
commit
1f961ccb0c
4 changed files with 14 additions and 6 deletions
|
@ -126,6 +126,12 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp {
|
||||||
public static Boolean operator <=(Integer a, Integer b) {
|
public static Boolean operator <=(Integer a, Integer b) {
|
||||||
return (a._value <= b._value) ? Boolean.TRUE : Boolean.FALSE;
|
return (a._value <= b._value) ? Boolean.TRUE : Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
public override int GetHashCode() {
|
||||||
|
return base.GetHashCode();
|
||||||
|
}
|
||||||
|
public override bool Equals(object? other) {
|
||||||
|
return base.Equals(other);
|
||||||
|
}
|
||||||
public static Boolean operator ==(Integer a, Integer b) {
|
public static Boolean operator ==(Integer a, Integer b) {
|
||||||
return (a._value == b._value) ? Boolean.TRUE : Boolean.FALSE;
|
return (a._value == b._value) ? Boolean.TRUE : Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp {
|
||||||
using FunctionLater = Func<Executor, IEnumerable<Expression>, Expression>;
|
using FunctionLater = Func<Executor, IEnumerable<Expression>, Expression>;
|
||||||
|
|
||||||
public interface IEnvironment<K, V> {
|
public interface IEnvironment<K, V> {
|
||||||
public V Get(K k);
|
public V? Get(K k);
|
||||||
public void Set(K k, V v);
|
public void Set(K k, V v);
|
||||||
public IEnvironment<K, V>? Find(K k);
|
public IEnvironment<K, V>? Find(K k);
|
||||||
public IEnvironment<K, V> Parent(bool recursive);
|
public IEnvironment<K, V> Parent(bool recursive);
|
||||||
|
@ -377,7 +377,11 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp {
|
||||||
if (_environment.Find(s.Name()) is not IEnvironment<string, Expression> env) {
|
if (_environment.Find(s.Name()) is not IEnvironment<string, Expression> env) {
|
||||||
throw new ApplicationException($"Could not find '{s.Name()}'");
|
throw new ApplicationException($"Could not find '{s.Name()}'");
|
||||||
}
|
}
|
||||||
return env.Get(s.Name());
|
var r_ = env.Get(s.Name());
|
||||||
|
if (r_ is null) {
|
||||||
|
throw new ApplicationException($"Could not find '{s.Name()}'");
|
||||||
|
}
|
||||||
|
return r_;
|
||||||
case Boolean b:
|
case Boolean b:
|
||||||
return b;
|
return b;
|
||||||
case Integer i:
|
case Integer i:
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace Jellyfin.Plugin.SmartPlaylist {
|
||||||
_fileSystem = fileSystem;
|
_fileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
private async Task<SmartPlaylistDto> LoadPlaylistAsync(string filename) {
|
private async Task<SmartPlaylistDto> LoadPlaylistAsync(string filename) {
|
||||||
var r = File.ReadAllText(filename);
|
var r = await File.ReadAllTextAsync(filename);
|
||||||
if (r.Equals("")) {
|
if (r.Equals("")) {
|
||||||
r = "{}";
|
r = "{}";
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ namespace Jellyfin.Plugin.SmartPlaylist {
|
||||||
public async Task SaveSmartPlaylistAsync(SmartPlaylistDto smartPlaylist) {
|
public async Task SaveSmartPlaylistAsync(SmartPlaylistDto smartPlaylist) {
|
||||||
string filename = _fileSystem.GetSmartPlaylistFilePath(smartPlaylist.Id);
|
string filename = _fileSystem.GetSmartPlaylistFilePath(smartPlaylist.Id);
|
||||||
var text = new SerializerBuilder().Build().Serialize(smartPlaylist);
|
var text = new SerializerBuilder().Build().Serialize(smartPlaylist);
|
||||||
File.WriteAllText(filename, text);
|
await File.WriteAllTextAsync(filename, text);
|
||||||
}
|
}
|
||||||
private void DeleteSmartPlaylistById(SmartPlaylistId smartPlaylistId) {
|
private void DeleteSmartPlaylistById(SmartPlaylistId smartPlaylistId) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
using Xunit;
|
|
||||||
using Lisp_Environment = Jellyfin.Plugin.SmartPlaylist.Lisp.Environment;
|
|
||||||
using Lisp_Boolean = Jellyfin.Plugin.SmartPlaylist.Lisp.Boolean;
|
using Lisp_Boolean = Jellyfin.Plugin.SmartPlaylist.Lisp.Boolean;
|
||||||
using Lisp_Object = Jellyfin.Plugin.SmartPlaylist.Lisp.Object;
|
using Lisp_Object = Jellyfin.Plugin.SmartPlaylist.Lisp.Object;
|
||||||
using Jellyfin.Plugin.SmartPlaylist.Lisp;
|
using Jellyfin.Plugin.SmartPlaylist.Lisp;
|
||||||
|
|
Loading…
Reference in a new issue