Compare commits

...

4 commits

4 changed files with 12 additions and 4 deletions

View file

@ -141,7 +141,7 @@ namespace Jellyfin.Plugin.SmartPlaylist.Lisp {
return args.Last(); return args.Last();
} }
private static Expression _haskeys(IEnumerable<Expression> args) { private static Expression _haskeys(IEnumerable<Expression> args) {
Object o = (Object) args.First(); Object o = new Object(((IInner) args.First()).Inner());
foreach (var e in args.Skip(1)) { foreach (var e in args.Skip(1)) {
String s = (String) e; String s = (String) e;
PropertyInfo? pi = o.Value().GetType().GetProperty(s.Value()); PropertyInfo? pi = o.Value().GetType().GetProperty(s.Value());

View file

@ -10,7 +10,7 @@ namespace Jellyfin.Plugin.SmartPlaylist {
(define is-genre-exact (lambda (g g-list) (find g g-list))) (define is-genre-exact (lambda (g g-list) (find g g-list)))
(define genre-list (lambda nil (let (_g (getitems item "Genres")) (if (null _g) nil (car _g))))) (define genre-list (lambda nil (let (_g (getitems item "Genres")) (if (null _g) nil (car _g)))))
(define is-favorite (lambda nil (invoke item "IsFavoriteOrLiked" (list user))))) (define is-favorite (lambda nil (invoke item "IsFavoriteOrLiked" (list user)))))
(define is-type (lambda (x) (and (haskeys item "GetClientTypeName") (invoke (invoke item "GetClientTypeName" nil) "Equals" (list x)))))
(define is-favourite is-favorite) (define is-favourite is-favorite)
"""; """;

View file

@ -22,10 +22,10 @@ changelog: |
the filter expressions. the filter expressions.
**Breaking Changes:** **Breaking Changes:**
- The lisp interpreter will no only detect strings in double quotes (`"`). - The lisp interpreter will now only detect strings in double quotes (`"`).
- The interpreter will also not allow specifying lists without quoting them. - The interpreter will also not allow specifying lists without quoting them.
`(1 2 3)` ... used to work but will no longer, replace by either specifying `(1 2 3)` ... used to work but will no longer, replace by either specifying
the list as `(list 1 2 3)` or (quote (1 2 3)). the list as `(list 1 2 3)` or `(quote (1 2 3))`.
## v0.1.1.0 ## v0.1.1.0
- Initial Alpha release. - Initial Alpha release.

View file

@ -2,6 +2,11 @@
Smart playlists with Lisp filter engine. Smart playlists with Lisp filter engine.
This readme contains instructions for the most recent changes in
the development branch (`main`). To view the file appropriate
for your version select the tag corresponding to your version.
The latest version is [v0.2.0.0](https://gitea.redxef.at/redxef/jellyfin-smart-playlist/src/tag/v0.2.0.0).
## How to use ## How to use
After [installing](#installation) the plugin and restarting Jellyfin After [installing](#installation) the plugin and restarting Jellyfin
@ -92,6 +97,9 @@ to: `(is-favourite)`.
allowed, the example filter would match the genre "Nu-Metal" (`(is-genre "metal" (genre-list))`) allowed, the example filter would match the genre "Nu-Metal" (`(is-genre "metal" (genre-list))`)
- **is-genre-exact**: the same as `is-genre`, but does not match paritally - **is-genre-exact**: the same as `is-genre`, but does not match paritally
- **is-favorite**: matches a favorite item (`(is-favorite)`) - **is-favorite**: matches a favorite item (`(is-favorite)`)
- **is-type**: matches the type of item look at
[BaseItemKind.cs](https://github.com/jellyfin/jellyfin/blob/master/Jellyfin.Data/Enums/BaseItemKind.cs)
for a list of items. The plugin has enabled support for `Audio, MusicAlbum, Playlist` (`(is-type "Audio")`)
### Filename ### Filename