Jump to content

New Plugin: Smart Playlists 2.0


ShaneP

Recommended Posts

chowbok

I figured it out. I have to have "Limited" set to "On". That doesn't really make much sense, I don't see what one thing has to do with the other, but there you go. I just have to be sure to set the limit to a number higher than the number of items in my list.

Thanks for taking a look.

Link to comment
Share on other sites

Junglejim
6 minutes ago, chowbok said:

I figured it out. I have to have "Limited" set to "On". That doesn't really make much sense, I don't see what one thing has to do with the other, but there you go. I just have to be sure to set the limit to a number higher than the number of items in my list.

Thanks for taking a look.

No probs mate, glad you got it sorted! Yea I think some sort options have to do with live/day/week etc. It can get a bit confusing. :) πŸ‘

Link to comment
Share on other sites

chowbok

Okay, I'm having a new problem now. When I generate a particular playlist, in the info box it says it added 1338 items, which sounds about right. But when I go to the list itself, it says there's fewer items. Sometimes it says 800, sometimes 1138, sometimes 1238, etc. I have to keep regenerating it until I get it at 1338.

Screenshot_2022-08-13_11-43-09.png

Screenshot_2022-08-13_11-42-44.png

Link to comment
Share on other sites

rbjtech

@ShaneP

First of all - amazing work on this plugin - really not sure how I missed this.

So you may be aware that @chefΒ is working on a 'Spotlight/Top Picks' plugin that shows items as a channel.

This is all working great (I'm part of the testing/ideas group) and it would make a HUGE feature improvement on this plugin if the output of the Smart Playlists were simply shown as a channel instead - ie on the front page, the same as a library.

Currently, the 'Spotlight' plugin just gets it's values from an XML file - by ItemId

So if you could export the 'Playlist' by Item Id (in the correct Sort Order) rather than a XML just showing the Path, then the 'Spotlight' plugin could easily be modified to show the SmartPlaylist output as a channel - much better than the horrid (imo) playlist output.

Maybe just write the export as a .txt file or something in the ..data\smartplaylists\<smartplaylist_id>\ area and the Spotlight/Channel plugin could pick it up from there - reading the JSON to get the Playlist details ..

Could be exciting .. :)

  • Like 2
Link to comment
Share on other sites

chowbok
On 8/13/2022 at 11:47 AM, chowbok said:

Okay, I'm having a new problem now. When I generate a particular playlist, in the info box it says it added 1338 items, which sounds about right. But when I go to the list itself, it says there's fewer items. Sometimes it says 800, sometimes 1138, sometimes 1238, etc. I have to keep regenerating it until I get it at 1338.

Β 

Β 

I have more items now, but same issue. An interesting thing about this is that it always generates a list that's either an even multiple of a hundred or a number that ends the same as the number it should be (e.g., if I have 1364 items, the list will be 964 or 1164, etc.).

Link to comment
Share on other sites

jmansell90

This plugin is fantastic!Β  I'm only having one issue, and it's that somehow the Parental rating is very unreliable.Β  For example, I'm making a 'kid friendly Halloween' collection.Β  The conditions are numerous but to simplify I made the following smart playlist:

smart_playlist_settings.thumb.PNG.5b9181c9a02c5c08cf220d311307e8de.PNG

As a note, I want to specify that it doesn't matter if I build with a range of Parental rating or specifically choose PG, the result is the same on the output.

Beetlejuice is rated PG in the metadata and is obviously named Beetlejuice.Β  It does not have the Genre 'Family' but many of the movies I want listed also are not specifically in Family.
smart_playlist_beetlejuice.PNG.900b7c7310304d452866099a1e7bf661.PNG

For comparison, I also added Hocus Pocus to showcase the issue.Β  Notice, it is also rated PG but is indeed in the genre Family:
smart_playlist_hucuspocus.PNG.d47106425125f8b2e52aa857bb9b9a8b.PNG

Β 

Since both are rated PG, we can reasonably expect both to show up in the collection.Β  However:
smart_playlist_output.PNG.826f2d4c9438528f51dae7066efeb3cd.PNG

Β 

We only have Hocus Pocus.Β  When I repeat the test by removing the Genre 'Family' both items disappear and the list is removed.

Interestingly, if I create an en-masse playlist of movies rated PG, many movies will show up rated PG.Β  Just very intermittent, and if I repeat the experiment an entire new set may show up.

Logging shows the following error:

2022-08-18 19:12:16.675 Error App: [SmartPlaylist][Error]: Value cannot be null. (Parameter 'first')
	*** Error Report ***
	Version: 4.7.6.0
	Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
	Operating system: Linux version 4.18.0-373.el8.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-10) (GCC)) #1 SMP Tue Mar 22 15:11
	Framework: .NET 6.0.2
	OS/Process: x64/x64
	Runtime: system/System.Private.CoreLib.dll
	Processor count: 12
	Data path: /config
	Application path: /system
	System.ArgumentNullException: System.ArgumentNullException: Value cannot be null. (Parameter 'first')
	   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
	   at System.Linq.Enumerable.Union[TSource](IEnumerable`1 first, IEnumerable`1 second, IEqualityComparer`1 comparer)
	   at SmartPlaylist.Handlers.CommandHandlers.SmartPlaylistUpdater.Update(SmartPlaylist smartPlaylist, BaseItem[] items)
	Source: System.Linq
	TargetSite: Void ThrowArgumentNullException(System.Linq.ExceptionArgument)



Running 2.4.0.1 on Emby 4.7.6 (Error was also found on 4.7.5)

Link to comment
Share on other sites

denywinarto

Hi, thanks for the effort. I've been asking this for years !

I'm having an issue though, can't seem to install the plugin, so I have placed the newest dll from github, v2.4.0.1 ontoΒ Z:\Programs\Emby\programdata\plugins

Rebooted emby server with v4.7.0.6.0, but I don't see it in my plugin list, or my advanced server tab like mentioned in the first page,

My installation is slightly different though, I'm running emby in portable mode and i installed it on Z folder,Β  cause i don't wanna bloat my limited C drive,

Is there anything else needed to get this working?

Edited by denywinarto
Link to comment
Share on other sites

Junglejim
13 hours ago, jmansell90 said:

This plugin is fantastic!Β  I'm only having one issue, and it's that somehow the Parental rating is very unreliable.Β  For example, I'm making a 'kid friendly Halloween' collection.Β  The conditions are numerous but to simplify I made the following smart playlist:

smart_playlist_settings.thumb.PNG.5b9181c9a02c5c08cf220d311307e8de.PNG

As a note, I want to specify that it doesn't matter if I build with a range of Parental rating or specifically choose PG, the result is the same on the output.

Beetlejuice is rated PG in the metadata and is obviously named Beetlejuice.Β  It does not have the Genre 'Family' but many of the movies I want listed also are not specifically in Family.
smart_playlist_beetlejuice.PNG.900b7c7310304d452866099a1e7bf661.PNG

For comparison, I also added Hocus Pocus to showcase the issue.Β  Notice, it is also rated PG but is indeed in the genre Family:
smart_playlist_hucuspocus.PNG.d47106425125f8b2e52aa857bb9b9a8b.PNG

Β 

Since both are rated PG, we can reasonably expect both to show up in the collection.Β  However:
smart_playlist_output.PNG.826f2d4c9438528f51dae7066efeb3cd.PNG

Β 

We only have Hocus Pocus.Β  When I repeat the test by removing the Genre 'Family' both items disappear and the list is removed.

Interestingly, if I create an en-masse playlist of movies rated PG, many movies will show up rated PG.Β  Just very intermittent, and if I repeat the experiment an entire new set may show up.

Logging shows the following error:

2022-08-18 19:12:16.675 Error App: [SmartPlaylist][Error]: Value cannot be null. (Parameter 'first')
	*** Error Report ***
	Version: 4.7.6.0
	Command line: /system/EmbyServer.dll -programdata /config -ffdetect /bin/ffdetect -ffmpeg /bin/ffmpeg -ffprobe /bin/ffprobe -restartexitcode 3
	Operating system: Linux version 4.18.0-373.el8.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.5.0 20210514 (Red Hat 8.5.0-10) (GCC)) #1 SMP Tue Mar 22 15:11
	Framework: .NET 6.0.2
	OS/Process: x64/x64
	Runtime: system/System.Private.CoreLib.dll
	Processor count: 12
	Data path: /config
	Application path: /system
	System.ArgumentNullException: System.ArgumentNullException: Value cannot be null. (Parameter 'first')
	   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
	   at System.Linq.Enumerable.Union[TSource](IEnumerable`1 first, IEnumerable`1 second, IEqualityComparer`1 comparer)
	   at SmartPlaylist.Handlers.CommandHandlers.SmartPlaylistUpdater.Update(SmartPlaylist smartPlaylist, BaseItem[] items)
	Source: System.Linq
	TargetSite: Void ThrowArgumentNullException(System.Linq.ExceptionArgument)



Running 2.4.0.1 on Emby 4.7.6 (Error was also found on 4.7.5)

Hi mate, first I'd remove the "movie is" filters. They are set to "Any" which is "OR" so it's picked the first in the list "Hocus Pocus". Get rid of all "movie is" and just use the "Genre" and "Parental Rating" set to "All" which is "AND" so it uses both filters. See how you go. :)

Β 

Edited by Junglejim
Link to comment
Share on other sites

Junglejim
3 hours ago, denywinarto said:

Hi, thanks for the effort. I've been asking this for years !

I'm having an issue though, can't seem to install the plugin, so I have placed the newest dll from github, v2.4.0.1 ontoΒ Z:\Programs\Emby\programdata\plugins

Rebooted emby server with v4.7.0.6.0, but I don't see it in my plugin list, or my advanced server tab like mentioned in the first page,

My installation is slightly different though, I'm running emby in portable mode and i installed it on Z folder,Β  cause i don't wanna bloat my limited C drive,

Is there anything else needed to get this working?

Hi mate, this looks like a Windows install. Not my area, I use Linux, maybe someone else could chime in here, but I think you should be looking to put the dll into emby/plugins?

My Linux install doesn't have a "programdata" folder just a "data/playlists" folder. That's ware all my created playlist data is stored (.xml,.jpg, .etc..)

Like I said I think a Windows user should be able to help more. ;)

Link to comment
Share on other sites

jmansell90
7 hours ago, Junglejim said:

Hi mate, first I'd remove the "movie is" filters. They are set to "Any" which is "OR" so it's picked the first in the list "Hocus Pocus". Get rid of all "movie is" and just use the "Genre" and "Parental Rating" set to "All" which is "AND" so it uses both filters. See how you go. :)

Β 

I'm not sure that's how an OR gate works my friend.Β  The 'Any' on movie names is because of course none of my movies will have both the names 'Hocus Pocus' AND 'Beetlejuice' but at least two of my movies have the name 'Hocus Pocus' OR 'Beetlejuice'.Β  If either of those are true it should be a 1 on the comparison output.Β  It should compare each movie to the list of rules, not just return the first movie that matches one criteria.

media.Type == 'Movie' && ( movie.Name == 'Hocus Pocus' || movie.Name == 'Beetlejuice' ) && movie.ParentalRating == 'PG'

This should return any file that is a Movie, is named either Hocus Pocus or Beetlejuice, and has a parental rating of PG.Β  As a note, the including a genre of Family was a *workaround* for the parental ratings not working.Β  So lets actually do a VERY clean test.Β  Lets get every bit of media that is rated PG:

movie.ParentalRating == 'PG'

This will return any media entry (TV, Movie, Audiobook, Channel, etc) rated PG and in the 'Horror' genre.Β  Right?Β  So let's give her a spin:

image.thumb.png.394dfa28d1f14b4dc2255059818235f6.png

Here's the windup... and the pitch...


image.png.31669ab1a43d2b1bb7c0a01c512cc5cd.png
Guess not...

Conclusion: The Parental Rating comparison is broken.

EDIT: I would like to mention for clarity that just in Movies alone I have 1600 items that are rated PG in the database:
image.thumb.png.48f9217590237ea320470a6686b54d73.png

Edited by jmansell90
Clarified one detail
Link to comment
Share on other sites

Junglejim
15 hours ago, jmansell90 said:

I'm not sure that's how an OR gate works my friend.Β  The 'Any' on movie names is because of course none of my movies will have both the names 'Hocus Pocus' AND 'Beetlejuice' but at least two of my movies have the name 'Hocus Pocus' OR 'Beetlejuice'.Β  If either of those are true it should be a 1 on the comparison output.Β  It should compare each movie to the list of rules, not just return the first movie that matches one criteria.

media.Type == 'Movie' && ( movie.Name == 'Hocus Pocus' || movie.Name == 'Beetlejuice' ) && movie.ParentalRating == 'PG'

This should return any file that is a Movie, is named either Hocus Pocus or Beetlejuice, and has a parental rating of PG.Β  As a note, the including a genre of Family was a *workaround* for the parental ratings not working.Β  So lets actually do a VERY clean test.Β  Lets get every bit of media that is rated PG:

movie.ParentalRating == 'PG'

This will return any media entry (TV, Movie, Audiobook, Channel, etc) rated PG and in the 'Horror' genre.Β  Right?Β  So let's give her a spin:

image.thumb.png.394dfa28d1f14b4dc2255059818235f6.png

Here's the windup... and the pitch...


image.png.31669ab1a43d2b1bb7c0a01c512cc5cd.png
Guess not...

Conclusion: The Parental Rating comparison is broken.

EDIT: I would like to mention for clarity that just in Movies alone I have 1600 items that are rated PG in the database:
image.thumb.png.48f9217590237ea320470a6686b54d73.png

Yea mate, I didn't mean use AND on the "Movie is" filters that would be crazy, I meant get rid of them all together, they shouldn't be needed and would give you a list of two movies but maybe that was you just testing things out that you knew should give a true value.

I meant use All/AND on the "genre" and "Parental rating" filters but now I see that Any/OR was a workaround for the Parental rating not working.

I just tested "Parental rating" is AU-PG and got nothing, zero. I have 67 movies with that rating if I filter my lib. So yes the parental rating seems broken.

In the smartplaylist log I get: Field: 'Parental rating': 'No metadata value found'

What's strange is the "Sort by: Parental rating" works fine so it can read the value there. I created a movies list and sorted by Parental rating asc and it worked out fine, listed from AU-G to AU-R18+. πŸ˜•

Edited by Junglejim
Link to comment
Share on other sites

denywinarto
21 hours ago, Junglejim said:

Hi mate, this looks like a Windows install. Not my area, I use Linux, maybe someone else could chime in here, but I think you should be looking to put the dll into emby/plugins?

My Linux install doesn't have a "programdata" folder just a "data/playlists" folder. That's ware all my created playlist data is stored (.xml,.jpg, .etc..)

Like I said I think a Windows user should be able to help more. ;)

Yeah it's windows server 2019,

emby/plugins folder doesn't exist,Β  onlyΒ 

Z:\Programs\Emby\programdata\plugins

Z:\Programs\Emby\system\plugins

I put the dll in both folders but it still wont work

Anyone got working method?

Or anyone from emby team could help me figure this out?

Link to comment
Share on other sites

Junglejim
21 minutes ago, denywinarto said:

Yeah it's windows server 2019,

emby/plugins folder doesn't exist,Β  onlyΒ 

Z:\Programs\Emby\programdata\plugins

Z:\Programs\Emby\system\plugins

I put the dll in both folders but it still wont work

Anyone got working method?

Or anyone from emby team could help me figure this out?

Yea that's weird, usually you restart your server/emby after installing a plugin but as you stated you have already done that.

Sorry I can't help more, I'm sure someone will help.Β @ShaneP would be better suited to answer this problem. :)

Link to comment
Share on other sites

jmansell90
On 8/20/2022 at 1:50 AM, denywinarto said:

Yeah it's windows server 2019,

emby/plugins folder doesn't exist,Β  onlyΒ 

Z:\Programs\Emby\programdata\plugins

Z:\Programs\Emby\system\plugins

I put the dll in both folders but it still wont work

Anyone got working method?

Or anyone from emby team could help me figure this out?

I believe it goes under programdata\plugins, and then you need to make sure permissions are good to go.

Something to try, since you downloaded from the web and Windows hates that.Β  Right click on the dll and click Properties.Β  At the bottom, check the box that says 'Unblock' if it is there then hit apply.Β  If my theory is right, Windows is blocking execution of the .dll (Screenshot is of another plugin)

image.png.f54ac90875f4824a3140b37dde2fc279.png

Link to comment
Share on other sites

denywinarto
5 hours ago, jmansell90 said:

I believe it goes under programdata\plugins, and then you need to make sure permissions are good to go.

Something to try, since you downloaded from the web and Windows hates that.Β  Right click on the dll and click Properties.Β  At the bottom, check the box that says 'Unblock' if it is there then hit apply.Β  If my theory is right, Windows is blocking execution of the .dll (Screenshot is of another plugin)

image.png.f54ac90875f4824a3140b37dde2fc279.png

Tried it, reboot emby, but it's the same, can't find it on plugins menu..

But you're right though it was still in blocked state,

thanks for this, could be useful in case I want to troubleshoot dll related error in the future.

Link to comment
Share on other sites

koopa8840
On 8/18/2022 at 11:50 PM, denywinarto said:

Rebooted emby server with v4.7.0.6.0

Update Emby server to v4.7.6.0.

Link to comment
Share on other sites

denywinarto
56 minutes ago, koopa8840 said:

Update Emby server to v4.7.6.0.

Ah yes that's another issue, I'm not sure whether it's related to my portable installation or not.

I already got "restart to finish installation" but even after I reboot that message came back again and I'm stuck atΒ v4.7.0.6.0, any thoughts?

Link to comment
Share on other sites

koopa8840
8 hours ago, denywinarto said:

Ah yes that's another issue, I'm not sure whether it's related to my portable installation or not.

I already got "restart to finish installation" but even after I reboot that message came back again and I'm stuck atΒ v4.7.0.6.0, any thoughts?

I've experienced that. Shutdown Emby server and make sure via task manager that Emby isn't running. Then manually install the update, overwriting the files, and then start up Emby.

Edited by koopa8840
  • Like 1
Link to comment
Share on other sites

denywinarto
12 hours ago, koopa8840 said:

I've experienced that. Shutdown Emby server and make sure via task manager that Emby isn't running. Then manually install the update, overwriting the files, and then start up Emby.

Finally it works, thanks!

I've tested it briefly, but I couldn't figure out a way to put the smart playlist into home library view, is it not possible?

My goal is to create recently added movies and shows with > 7 ratings

Link to comment
Share on other sites

koopa8840
25 minutes ago, denywinarto said:

Finally it works, thanks!

I've tested it briefly, but I couldn't figure out a way to put the smart playlist into home library view, is it not possible?

My goal is to create recently added movies and shows with > 7 ratings

The smart playlist will be displayed in either: in Collections if you created a collection or Playlists if you created a playlist. You can't have a home screen tile of your created collection/playlist.

Link to comment
Share on other sites

denywinarto
12 hours ago, koopa8840 said:

The smart playlist will be displayed in either: in Collections if you created a collection or Playlists if you created a playlist. You can't have a home screen tile of your created collection/playlist.

So there's absolutely no way to put it into recently added style in home page?

Link to comment
Share on other sites

koopa8840
On 8/24/2022 at 7:35 AM, denywinarto said:

So there's absolutely no way to put it into recently added style in home page?

Not that I know of.

Link to comment
Share on other sites

DarKni8
On 3/29/2022 at 11:20 PM, deiniol39 said:

Love the plugin, any way to do resolution Filter. Or am I just missing something. Would like to do one for 4k movies.

Edited by DarKni8
Following up on this
Link to comment
Share on other sites

horstepipe

Hey

I'm trying to setup a "recently watched" playlist for each user. Please see the screenshot for configuration.

Any idea what is wrong? The playlist stays empty, I tried accessing it with multiple user accounts, but it is always empty.

playlist.thumb.png.f548c2dfd38a9eb279c000fd44a9ccea.png

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...