feat: program matches item if result != nil.
This commit is contained in:
parent
f37f825c53
commit
51e300bdc1
1 changed files with 3 additions and 7 deletions
|
@ -110,13 +110,9 @@ namespace Jellyfin.Plugin.SmartPlaylist.ScheduledTasks {
|
|||
executor.environment.Set("item", new Lisp_Object(i));
|
||||
var r = executor.eval(expression);
|
||||
_logger.LogTrace("Item {0} evaluated to {1}", i, r.ToString());
|
||||
if (r is Lisp_Boolean r_bool) {
|
||||
if (r_bool.value) {
|
||||
_logger.LogDebug("Added '{0}' to Smart Playlist {1}", i, smartPlaylist.Name);
|
||||
results.Add(i.Id);
|
||||
}
|
||||
} else {
|
||||
_logger.LogInformation("Program did not return a boolean, returned {0}", r.ToString());
|
||||
if ((r is not Lisp_Boolean r_bool) || (r_bool.value)) {
|
||||
_logger.LogDebug("Added '{0}' to Smart Playlist {1}", i, smartPlaylist.Name);
|
||||
results.Add(i.Id);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
|
Loading…
Reference in a new issue