Jump to content

New Plugin: Smart Playlists


saladin

Recommended Posts

Hi,

 

I created emby plugin that gives ability to create smart playlists. It works just like iTunes smart playlists -> based on specified rules, playlists will be automatically updated during library changes.

 

  • to set rules user must have rights to manage the server
  • rules are specified inside plugin configuration section(in current logged user context): "Manage Emby Server" -> "Advanced" -> "SmartPlaylist".
  • name of smart playlist determines which playlist will be updated
  • playlist will be created automatically if did not exist before
  • playlist will always be updated after saving rules
  • user can set 3 types of update:
    • Live -> update playlist if library changes with conditions -> update after 1000 changed items or update after 2 minutes of inactivity or update after 5 minutes
    • Manual -> update playlist only after saving rules
    • ShuffleDaily/ShuffleWeekly/ShuffleMonthly -> update playlist daily/weekly/monthly
  • rules can be grouped
  • groups can be nested
  • strings are compared in case insensitive manner
  • tested on Windows/Linux with Emby 4.4.0.16 beta

 

Feel free to test.

 

v1.3.0.0(v0.9.1.0 - for emby 4.3.1.0):

  • filter by: Actor\GuestStar, Director, Path, Tags, ReleaseDate, ParentalRating, CommunityRating, Runtime
  • sort by: SortName, ReleaseDate, ParentalRating, CommunityRating, Runtime, Episode(combination of SeriesName and SortName)
  • fix setting proper MediaType for new playlists
  • fix Random sort
  • removed Series MediaType -> use Series criteria instead

 

v1.2.0.0:

  • filter by series -> add "MediaType: Series" and criteria: "Episode Name", "Series" 
  • filter by movie name

 

 

Source code: https://github.com/ppankiewicz/Emby.SmartPlaylist.Plugin

SmartPlaylist v0.9.0.0 - for emby 4.3.1.0.zip

SmartPlaylistv1.2.0.0.zip

SmartPlaylist v1.3.0.0.zip

SmartPlaylist v0.9.1.0-foremby4.3.1.0.zip

Edited by saladin
  • Like 18
  • Haha 1
Link to comment
Share on other sites

This is something I just have to try!!!

 

EDIT: @@saladin

 

A few questions:

 

  • Is there a possibility to create a Library out of the Smart Playlist?
  • Will users (eventually) be able to create their own personal playlists without needing admin rights, which they can share (or not) with other users?

--------------------------------------------

 

EDIT2: 

 

I have to say, though it works pretty well! I created a simple music play-list for the 1990s and this was done quite rapidly. Great work!!!! I really like this!

 

The config page does need some work. though. It's not very easy to figure out and I cannot select any sort options. It just says random.

 

Also, I tried to make a DC Universe List with Series and Movies, sorted by release date and I have not yet been able to... Next to the fact that I cannot set the sorting options, it's very involved to select a complete series and separate movies.

 

--------------------------------------------

 

EDIT3:

 

I really love this plugin! I have no idea where the list "Most Active Movies (last 14 days)", Test and X-Men come from, but my lists run properly. What I noticed it that it takes a very long time before the list contents are displayed. We're talking minutes... I don't know if this because of the plugin or Emby itself... funnily enough it's faster on the Android TV than on the Webpage

 

--------------------------------------------

 

EDIT4: 

 

Seems I've run into a bit of an issue. I have various libraries that have multiple locations for their content. It seems that only the first location is scanned for content and content in a second location (or 3rd or 4th) within the same library is not added to the list, even though the criteria matches. The same goes for different libraries with the same content type. Only content from the first library it finds will be added.

 

Also, I miss a few options for setting up rules. For me it would really make sense if under Date Added there would be an option that says "Today" or "Yesterday" so that whenever I click the list, I get stuff that was added the day I click that list and not have a static date.

It would also make sense to me to be able to directly add a specific series, or tag or even a Live TV channel or any of the options you have for library content types and not having to set 2 separate criteria for that.

Edited by Dibbes
Link to comment
Share on other sites

webpostkastl

Hi saladin, if this really works you are my hero :)

unfortunately I failed while copying your dll file to my emby server plugin directory

I'm running Emby on a Synology NAS and tried to copy it to path /var/packages/EmbyServer/target/plugins/SmartPlaylist.dll

but WinSCP just tells me: permission denied and I was not able to change permissions for the plugins folder

any idea how I can solve this?

 

 

 

Link to comment
Share on other sites

Hi saladin, if this really works you are my hero :)

unfortunately I failed while copying your dll file to my emby server plugin directory

I'm running Emby on a Synology NAS and tried to copy it to path /var/packages/EmbyServer/target/plugins/SmartPlaylist.dll

but WinSCP just tells me: permission denied and I was not able to change permissions for the plugins folder

any idea how I can solve this?

 

Can you copy any other file to the plugin folder? Are you using an account that has rights on that folder?

 

If not, then you're going to have to ssh with a sudo enabled user, then change permissions with chmod and try again

Link to comment
Share on other sites

webpostkastl

Can you copy any other file to the plugin folder? Are you using an account that has rights on that folder?

 

If not, then you're going to have to ssh with a sudo enabled user, then change permissions with chmod and try again

no, I can't copy anything else as well. I tried to access with my main Synology admin user and noticed that embysvr is the owner of the plugin folder

but unfortunately I can't connect with this user, because I don't know the password (which is set automatically during the installation as far as I know)

and I'm not sure what will happen if I change the user password ...?

any hints on how I could connect with a sudo enabled user? shouldn't the admin user be a sudo enabled one?

appreciate your help, Dibbes!

Link to comment
Share on other sites

no, I can't copy anything else as well. I tried to access with my main Synology admin user and noticed that embysvr is the owner of the plugin folder

but unfortunately I can't connect with this user, because I don't know the password (which is set automatically during the installation as far as I know)

and I'm not sure what will happen if I change the user password ...?

any hints on how I could connect with a sudo enabled user? shouldn't the admin user be a sudo enabled one?

appreciate your help, Dibbes!

 

You set the password for the embysvr account during setup... you should be able to just reset the password for it without causing any issues. I just tried on my box and now problems whatsoever

Link to comment
Share on other sites

...I have no idea where the list "Most Active Movies (last 14 days)"

 

I believe that one comes from the Playback Reporting plugin

Link to comment
Share on other sites

pünktchen

Really great @@saladin!

 

Same question as @@Dibbes. How would i create a rule to include only episodes of a named tv show?

Probably it's just missing the MediaType TVShow filter, then we could filter by Name after this.

 

Also please add a filter for actors (includes guest stars of tv episodes) and directors.

 

Small typo in the config start screen: "Add new samrtplaylist" ;)

  • Like 1
Link to comment
Share on other sites

Nice! Thank you for putting this together, this is great!

 

Took me a minute to figure out how to get it to work on Windows but got it functioning correctly now.

 

A few improvements come to mind:

 

1. Missing a few fields that are visible in Reports that would be helpful (Runtime, CommunityRating, ParentalRating, Resolution, ReleaseDate)

2. Missing fields that are not visible in Reports that are in my nfo files - but not sure which of these are actually imported into Emby (Country, Audio Language, Studio, Credits, Director, Actor, Languages)

EDIT - Audio Language, Director, Actor must be accessible somehow since they appear on the movie's page. Really hoping Country is available also as this is one of my main use cases for smart playlists in Kodi

EDIT - This post seems to indicate that Emby does import Country into the database, but I guess it's just not visible anywhere

3. Sorting is also missing some fields that would be nice (Year, CommunityRating, ParentalRating, Runtime)

Edited by mhendu
Link to comment
Share on other sites

Sounds great and I want it to try. I made a test playlist but where I can found the playlist? When I go to playlists it is empty...

 

EDIT: Found it... was a typo in path

Edited by bgx
Link to comment
Share on other sites

PenkethBoy

Just tried this out and Generally a great addition to Emby

 

we do need some way of filtering by a named tv series and a TVShow media type

 

as currently can only get episodes by number or name (but that does not include the series name as not stored like that in Emby)

 

Good Start :) 

Link to comment
Share on other sites

Wow great.

It's a feature I've been waiting for. So far works well.
I created a playlist called Randomly Unseen Movies.
Rules:
Media Type is movie
play count is 0
limit: 30
sort by: random

What I would still like to see would be that the playlist shows different films each time it is called up. Now the same 30 films are always available. So that it is really randomly.

Edited by OOmatrixOO
Link to comment
Share on other sites

EDIT4: 

 

Seems I've run into a bit of an issue. I have various libraries that have multiple locations for their content. It seems that only the first location is scanned for content and content in a second location (or 3rd or 4th) within the same library is not added to the list, even though the criteria matches. The same goes for different libraries with the same content type. Only content from the first library it finds will be added.

 

Im seeing the same issue. I have TV shows that span 2 different drive locations and the plugin seems to only be picking up one location.

Link to comment
Share on other sites

gillmacca01

Looking forward to testing this out, but having an issue. I am running latest beta on QNAP. I have copied the dll to my plugins, and restarted Emby.

I can see it under plugins and under Advanced in the dashboard, but access from the menu or settings under plugins, all I get is a blank screen

 

 

ignore this: working now

Edited by gillmacca01
Link to comment
Share on other sites

gillmacca01

@Dibbes

Reference DC Universe: If you tick limit, then it unlocks 'sort by'.

Can you tell me how you did DC Universe, as I have a collection that I have marked as a favourite, and cannot get it to create a playlist

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

Reference DC Universe: If you tick limit, then it unlocks 'sort by'.

 

Yes, it does, until you make changes, then it jumps back to random and it's locked again and doesn't unlock anymore, unless you play with the zoom function of the browser and add and remove numbers in the max items box...

 

 

Can you tell me how you did DC Universe, as I have a collection that I have marked as a favourite, and cannot get it to create a playlist

 

I haven't Been able to get it to work properly yet, as I've been running into this issue:

 

 

EDIT4: 

 

Seems I've run into a bit of an issue. I have various libraries that have multiple locations for their content. It seems that only the first location is scanned for content and content in a second location (or 3rd or 4th) within the same library is not added to the list, even though the criteria matches. The same goes for different libraries with the same content type. Only content from the first library it finds will be added.

 

So once I ran into that, I didn't continue... sorry.

 

If you're interested, this is what I entered till now. Unfortunately I don't get any returns...

 

5e5053aa4d757_Untitled.png

Edited by Dibbes
Link to comment
Share on other sites

PenkethBoy

you wont get any results using a series name against an episode - as Episode are not named with a prefix of series name

 

They may be on your file system - but once emby matches up with online metadata the series name is removed

Link to comment
Share on other sites

you wont get any results using a series name against an episode - as Episode are not named with a prefix of series name

 

They may be on your file system - but once emby matches up with online metadata the series name is removed

 

Which, though irritating for a plugin like this, should still give me a few results...

Link to comment
Share on other sites

PenkethBoy

Name = Name of Episode or name of movie

Not name of Series

 

so no those options wont work as the plugin is now

Link to comment
Share on other sites

Name = Name of Episode or name of movie

Not name of Series

 

so no those options wont work as the plugin is now

Yes, I got that... but there's also a movie named in it... it should at least give me that... it doesn't

Link to comment
Share on other sites

PenkethBoy

it would - probably if it was - a less complicated series of search options

 

try a new smartplaylist and just do a single condition

 

although .16 has goosed the plugin interface - so i cant show you some of my tests at the moment

Link to comment
Share on other sites

PenkethBoy

ok some working examples - from my playing around so far

 

5e5106e542865_Annotation20200222104652.j

 

Name-contains-episode - as in the name of the episode as "known" by Emby = gives a list of episodes from random series where the Episode is in the name 

which is great but needs a Series option or this plugin is only half useful :)

 

5e51075f09a76_Annotation20200222104647.j

list of unplayed movies - might be useful - just me messing around

 

5e51078e96dd1_Annotation20200222104640.j

 

list of movies with Harry in the name

 

I have not played with the nested condition option yet as waiting on having more control to get what i want in a playlist

 

Hopefully the OP will comeback with an update

Link to comment
Share on other sites

I have a few that work as well.. Music released in 1985, Music released in the decade 90-99, Movies added in the last 2 weeks and more of that... the simple queries work and work well... it's the more complicated ones that have issues displaying stuff...

 

Emby takes a long time displaying the list of items added when there's a large list though

Edited by Dibbes
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...