Jump to content

New Plugin: Smart Playlists 2.0


ShaneP

Recommended Posts

horstepipe

@ShaneP

On library scan I'm getting this error:

2022-10-18 16:47:34.617 Error App: [SmartPlaylist][Error]: Value cannot be null. (Parameter 'first')
        *** Error Report ***
        Version: 4.7.8.0
        Command line: /opt/emby-server/system/EmbyServer.dll -programdata /var/lib/emby -ffdetect /opt/emby-server/bin/ffdetect -ffmpeg /opt/emby-server/bin/ffmpeg -ffprobe /opt/emby-server/bin/ffprobe -restartexitcode 3 -updatepackage emby-server-deb_{version}_amd64.deb
        Operating system: Linux version 5.4.0-126-generic (buildd@lcy02-amd64-072) (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1)) #142-Ubuntu SMP Fri Aug 26 12:12:57 UTC 2
        Framework: .NET 6.0.8
        OS/Process: x64/x64
        Runtime: opt/emby-server/system/System.Private.CoreLib.dll
        Processor count: 8
        Data path: /var/lib/emby
        Application path: /opt/emby-server/system
        System.ArgumentNullException: System.ArgumentNullException: Value cannot be null. (Parameter 'first')
           at SmartPlaylist.Handlers.CommandHandlers.SmartPlaylistUpdater.Update(SmartPlaylist smartPlaylist, BaseItem[] items)
           at SmartPlaylist.Handlers.CommandHandlers.SmartPlaylistUpdater.Update(SmartPlaylist smartPlaylist, BaseItem[] items)
           at SmartPlaylist.Handlers.CommandHandlers.UpdateAllSmartPlaylistsCommandHandler.GetTasks(SmartPlaylist smartPlaylist, BaseItem[] items)
           at SmartPlaylist.Handlers.CommandHandlers.UpdateAllSmartPlaylistsCommandHandler.UpdateSmartPlaylistsWithNewItemsAsync(BaseItem[] items, SmartPlaylist[] smartPlaylists)
           at SmartPlaylist.Handlers.CommandHandlers.UpdateAllSmartPlaylistsCommandHandler.HandleAsync(UpdateAllSmartPlaylistsCommand message)
           at SmartPlaylist.PerfLoggerDecorators.PerLoggerMessageDecorator`1.HandleAsync(T message)
           at SmartPlaylist.Infrastructure.MesssageBus.Decorators.SuppressAsyncExceptionDecorator`1.HandleAsync(T message)
        Source: SmartPlaylist
        TargetSite: Void MoveNext()

I'm having a bunch of collections created by the plugin, any way to determine from which collection the error comes from? If not, could you please add the info to the log output?

Best regards

Edited by horstepipe
Link to comment
Share on other sites

Bazzu85

Hi @ShaneP

 

I found a problem using the Release date field:

1. Using with a movie name like this

image.thumb.png.5366184d07d18461688bf8785f4c26fa.png

works. But every time I save the date is decreased by one day. Here's after the save

image.thumb.png.b344125f3ec2729c27300bf77d30f999.png

is this a know issue?

image.png

Link to comment
Share on other sites

Idealbrandon

Plugin seems amazing. A few questions I'm hoping to clarify...

1. There is an issue with Che's Emby.NewReleases plugin that ends up adding duplicate entries into things like search results. Apparently it affects these playlists as well.  Is there a way around this, like possibly limiting a playlist to only search in specified libraries?

2. Any way to change the display mode so it shows movie posters in rows like other content views have?

3. I think the answer is no, but is there any way to add to home screen rows?

Link to comment
Share on other sites

Idealbrandon

I think I figured out all my other questions, but wondering if there is a way to create a playlist to show movies that contain at least 2 actors from a list of actors. So for example, I want to create a playlist that will show any movie that contains at least two of the following actors: Will Ferrell, Steve Carell, Vince Vaughn, Paul Rudd, etc.

Is there a way to accomplish this?

Link to comment
Share on other sites

koopa8840
22 minutes ago, Idealbrandon said:

I think I figured out all my other questions, but wondering if there is a way to create a playlist to show movies that contain at least 2 actors from a list of actors. So for example, I want to create a playlist that will show any movie that contains at least two of the following actors: Will Ferrell, Steve Carell, Vince Vaughn, Paul Rudd, etc.

Is there a way to accomplish this?

You would set the rule to be ANY and then an entry for each actor, so by your example you would have 4 Actor entries. Or you can use this button, use Actors set to "contains", list the names and it will add the entries automatically.

image.png.177eeede42ce39fefac68188e89e8dc3.png

Link to comment
Share on other sites

Idealbrandon
53 minutes ago, koopa8840 said:

You would set the rule to be ANY and then an entry for each actor, so by your example you would have 4 Actor entries. Or you can use this button, use Actors set to "contains", list the names and it will add the entries automatically.

image.png.177eeede42ce39fefac68188e89e8dc3.png

So, wouldn't this return any movie that contained any of those four actors? I am specifically looking to create a rule that would return results if it matched two or more actors from the list.

Along with this, I am really struggling to figure out how to make these groups work. For example, if I want to create a playlist with any movie OR tv series with a name that contains harry potter OR fantastic beasts OR hogwarts, I thought I would set that up this way:

image.thumb.png.da67291311a0df0a95d5191fc8acacc7.png

or this way:

image.thumb.png.ea26f5a86fed81097f07a1dbbe0e45c9.png

But both of these results return TONS of matches, so obviously this isn't the right way to do this.

Link to comment
Share on other sites

koopa8840
On 10/29/2022 at 1:43 PM, Idealbrandon said:

So, wouldn't this return any movie that contained any of those four actors? I am specifically looking to create a rule that would return results if it matched two or more actors from the list.

Along with this, I am really struggling to figure out how to make these groups work. For example, if I want to create a playlist with any movie OR tv series with a name that contains harry potter OR fantastic beasts OR hogwarts, I thought I would set that up this way:

image.thumb.png.da67291311a0df0a95d5191fc8acacc7.png

or this way:

image.thumb.png.ea26f5a86fed81097f07a1dbbe0e45c9.png

But both of these results return TONS of matches, so obviously this isn't the right way to do this.

Can you post what the results are and what they should be? I might be able to find a solution.

Link to comment
Share on other sites

  • 3 weeks later...
sdfgdtfhrztrhgd

how can i put tv series in a smart playlist? So that when i open the playlist i only the the series names first and when i click on a tv series i see the seasons. is there any way?

Link to comment
Share on other sites

  • 4 weeks later...

UPDATE: I'm no coder, but after doing a little digging, it seems the Emby API doesn't refer to it as the 'Parental Rating' in the background, but as the 'Official Rating'. However, after doing a quick scan of the code for the plugin in github, I couldn't find a reference to 'Official' only 'Parental'. So I wonder if that's the issue? I've no idea TBH, but it honestly seems like something an Emby Dev could fix in an hour. But they won't, of course.

 

Can someone please explain why this doesn't seem to work for me? I must be missing something. I tried ages ago & reported the issue but didn't really get a clear answer I don't think.

Here's a simple example:

image.thumb.png.4060227c32bd418cb076045a51301247.png


So, it should add all movies that are below PG-13 rating. However, it never adds any movies and all I get from the log is this on it's scan of every movie:

[18/12/2022 01:24:59]: Query: WHERE (Media Type is Movie AND Parental rating is less than PG-13)   
[18/12/2022 01:24:59]: Comparing: 'The 'Burbs', Field: 'Media Type', Expected: 'Movie', Actual: 'Movie', Operator: 'is', Type: 'listMapValue', Context 'RixHome', Matched: True
[18/12/2022 01:24:59]: Incomparable: 'The 'Burbs', Field: 'Parental rating': 'No metadata value found'
[18/12/2022 01:24:59]: 'The 'Burbs' failed to match on criteria.

 

BUT, there absolutely IS parental rating metadata for each of the movies, as demonstrated here:

image.png.d3da6221d3bb8068c85d32609295d663.png

What's causing this? It's driving me mad.

Edited by smernt
Link to comment
Share on other sites

ShaneP
2 hours ago, smernt said:

UPDATE: I'm no coder, but after doing a little digging, it seems the Emby API doesn't refer to it as the 'Parental Rating' in the background, but as the 'Official Rating'. However, after doing a quick scan of the code for the plugin in github, I couldn't find a reference to 'Official' only 'Parental'. So I wonder if that's the issue? I've no idea TBH, but it honestly seems like something an Emby Dev could fix in an hour. But they won't, of course.

 

Can someone please explain why this doesn't seem to work for me? I must be missing something. I tried ages ago & reported the issue but didn't really get a clear answer I don't think.

Here's a simple example:

image.thumb.png.4060227c32bd418cb076045a51301247.png


So, it should add all movies that are below PG-13 rating. However, it never adds any movies and all I get from the log is this on it's scan of every movie:

[18/12/2022 01:24:59]: Query: WHERE (Media Type is Movie AND Parental rating is less than PG-13)   
[18/12/2022 01:24:59]: Comparing: 'The 'Burbs', Field: 'Media Type', Expected: 'Movie', Actual: 'Movie', Operator: 'is', Type: 'listMapValue', Context 'RixHome', Matched: True
[18/12/2022 01:24:59]: Incomparable: 'The 'Burbs', Field: 'Parental rating': 'No metadata value found'
[18/12/2022 01:24:59]: 'The 'Burbs' failed to match on criteria.

 

BUT, there absolutely IS parental rating metadata for each of the movies, as demonstrated here:

image.png.d3da6221d3bb8068c85d32609295d663.png

What's causing this? It's driving me mad.

Hey @smernt, thanks for the investigation, I have a few days to pick up this project again and added it to the list, will fix this up for you. Not sure of this has always been a bug or that fields have changed after releases. But a minor fix. I have fixed a few other things and will put out a release over the next few days. :)

  • Thanks 1
Link to comment
Share on other sites

ShaneP
On 11/3/2022 at 6:01 PM, akawoz said:

Do we need a change to support this? Very exciting news!

image.thumb.png.50fa30a73a847b5e36eed163d2229f4f.png

This is awesome @akawoz, I'll have a look at the API to get an idea of what's involved.

  • Like 1
Link to comment
Share on other sites

ShaneP
On 11/20/2022 at 10:35 AM, sdfgdtfhrztrhgd said:

how can i put tv series in a smart playlist? So that when i open the playlist i only the the series names first and when i click on a tv series i see the seasons. is there any way?

Hey @sdfgdtfhrztrhgd, this can be done by using a collection and "rolling up" to the season or series. I think I called it epimode.

Link to comment
Share on other sites

31 minutes ago, ShaneP said:

Hey @smernt, thanks for the investigation, I have a few days to pick up this project again and added it to the list, will fix this up for you. Not sure of this has always been a bug or that fields have changed after releases. But a minor fix. I have fixed a few other things and will put out a release over the next few days. :)

Thanks Shane, that’s great!

 

Also, after just reading it back myself, I hope the frustration in my comment didn’t feel targeted at you, as we’re all very grateful for the work the time and effort you put in for this!

My frustration lies solely with the official devs for their lack of input on these kinds of features that really should have been implemented into the core app years ago.

Link to comment
Share on other sites

ShaneP
5 minutes ago, smernt said:

Thanks Shane, that’s great!

 

Also, after just reading it back myself, I hope the frustration in my comment didn’t feel targeted at you, as we’re all very grateful for the work the time and effort you put in for this!

My frustration lies solely with the official devs for their lack of input on these kinds of features that really should have been implemented into the core app years ago.

Yea, that's what I got out of it :D, we all good man!

  • Like 1
Link to comment
Share on other sites

sdfgdtfhrztrhgd
1 hour ago, ShaneP said:

Hey @sdfgdtfhrztrhgd, this can be done by using a collection and "rolling up" to the season or series. I think I called it epimode.

Where can i found epimode? I can Not find this.

Link to comment
Share on other sites

brianread108

Sorry if this question has an obvious answer, but I've been unable to find anything. I run Emby server in a Linux based Container, and all my clients are Linux or Android.  This plugin looks to be only Windows based (a dll?). Is there any support anywhere for the same functionality that I could use?

 

Link to comment
Share on other sites

10 minutes ago, brianread108 said:

Sorry if this question has an obvious answer, but I've been unable to find anything. I run Emby server in a Linux based Container, and all my clients are Linux or Android.  This plugin looks to be only Windows based (a dll?). Is there any support anywhere for the same functionality that I could use?

 

I run Emby on a Synology NAS which is based on Linux and just drop the DLL in the Emby plug-in folder. As far as I know, all Emby plugins are DLLs

Link to comment
Share on other sites

ShaneP
20 hours ago, sdfgdtfhrztrhgd said:

Where can i found epimode? I can Not find this.

You should see it when you select type as collection. 
 

 

 

 

image.png

Edited by ShaneP
  • Thanks 1
Link to comment
Share on other sites

brianread108
28 minutes ago, smernt said:

I run Emby on a Synology NAS which is based on Linux and just drop the DLL in the Emby plug-in folder. As far as I know, all Emby plugins are DLLs

Aha - that is good news, I'll try it -- many thanks.

Link to comment
Share on other sites

Happy2Play

@brianread108 Don't really know the Linux structure but it goes in the programdata\plugins folder not the system\plugins folder.  You may have to verify correct permissions also when manually placing the file also.

Link to comment
Share on other sites

brianread108
54 minutes ago, Happy2Play said:

@brianread108 Don't really know the Linux structure but it goes in the programdata\plugins folder not the system\plugins folder.  You may have to verify correct permissions also when manually placing the file also.

This seems to work:

[root@emby11 ~]# ls -l  /opt/emby-server/system/plugins/SmartPlaylist.dll 
-rw-r--r-- 1 root root 969728 Dec 19 09:55 /opt/emby-server/system/plugins/SmartPlaylist.dll
[root@emby11 ~]# 

 

Link to comment
Share on other sites

Happy2Play
4 minutes ago, brianread108 said:

This seems to work:

[root@emby11 ~]# ls -l  /opt/emby-server/system/plugins/SmartPlaylist.dll 
-rw-r--r-- 1 root root 969728 Dec 19 09:55 /opt/emby-server/system/plugins/SmartPlaylist.dll
[root@emby11 ~]# 

 

Even if it is the wrong folder, system plugins automatically copy to /var/lib/emby/plugins.  You should see this in the server log.

  • Agree 1
Link to comment
Share on other sites

Junglejim
41 minutes ago, Happy2Play said:

Even if it is the wrong folder, system plugins automatically copy to /var/lib/emby/plugins.  You should see this in the server log.

I run Emby in a docker (so my paths are configured there) but /var/lib/ should be the right dir. Mine is '/var/lib/docker/appdata/emby/plugins' (but it's a custom path).

If it works your all good. User perms shouldn't affect it too much (I guess you copied it over as root)? It's only if this app goes into the catalog and you reinstall from there you will get a error because root of perms. ;)  It's a easy fix for the perms though if your OCD like me.

Edited by Junglejim
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...