2024-06-27 01:47:44 +02:00
|
|
|
using MediaBrowser.Model.Plugins;
|
|
|
|
|
|
|
|
namespace Jellyfin.Plugin.SmartPlaylist {
|
|
|
|
public class PluginConfiguration : BasePluginConfiguration {
|
2024-11-08 03:09:17 +01:00
|
|
|
public PluginConfiguration() {
|
|
|
|
InitialProgram = """
|
|
|
|
(begin
|
|
|
|
(define lower (lambda (s) (invoke s "ToLower" nil)))
|
|
|
|
(define is-genre (lambda (g g-list) (any (lambda (x) (invoke (lower x) "Contains" (list (lower 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)))))
|
2024-11-11 14:12:35 +01:00
|
|
|
(define is-favorite (lambda nil (invoke item "IsFavoriteOrLiked" (list user))))
|
2024-11-08 22:41:24 +01:00
|
|
|
(define is-type (lambda (x) (and (haskeys item "GetClientTypeName") (invoke (invoke item "GetClientTypeName" nil) "Equals" (list x)))))
|
2024-11-11 14:12:35 +01:00
|
|
|
(define name-contains (lambda (x) (invoke (lower (car (getkeys item "Name"))) "Contains" (list (lower x)))))
|
2024-11-08 03:09:17 +01:00
|
|
|
|
2024-11-11 14:12:35 +01:00
|
|
|
(define is-favourite is-favorite))
|
2024-11-08 03:09:17 +01:00
|
|
|
""";
|
2024-06-27 01:47:44 +02:00
|
|
|
}
|
2024-11-08 03:09:17 +01:00
|
|
|
public string InitialProgram { get; set; }
|
2024-06-27 01:47:44 +02:00
|
|
|
}
|
|
|
|
}
|