Jump to content


Photo

New Plugin: SmartPlaylists


  • Please log in to reply
170 replies to this topic

#1 saladin OFFLINE  

saladin

    Member

  • Members
  • 16 posts
  • Local time: 09:34 AM

Posted 19 February 2020 - 02:13 PM

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/p...Playlist.Plugin

Attached Files


Edited by saladin, 28 February 2020 - 08:40 PM.

  • chef, ginjaninja, Spaceboy and 13 others like this

#2 Dibbes OFFLINE  

Dibbes

    Advanced Member

  • Members
  • 1231 posts
  • Local time: 10:34 AM
  • LocationMadrid, Spain

Posted 19 February 2020 - 02:36 PM

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, 19 February 2020 - 07:07 PM.


#3 webpostkastl OFFLINE  

webpostkastl

    Member

  • Members
  • 24 posts
  • Local time: 09:34 AM

Posted 19 February 2020 - 03:32 PM

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?

 

 

 



#4 Dibbes OFFLINE  

Dibbes

    Advanced Member

  • Members
  • 1231 posts
  • Local time: 10:34 AM
  • LocationMadrid, Spain

Posted 19 February 2020 - 03:39 PM

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



#5 Spaceboy OFFLINE  

Spaceboy

    Advanced Member

  • Members
  • 4769 posts
  • Local time: 09:34 AM

Posted 19 February 2020 - 03:42 PM

Yes please. I will download and orovide feedback in time. Well done!

#6 webpostkastl OFFLINE  

webpostkastl

    Member

  • Members
  • 24 posts
  • Local time: 09:34 AM

Posted 19 February 2020 - 04:29 PM

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!



#7 Dibbes OFFLINE  

Dibbes

    Advanced Member

  • Members
  • 1231 posts
  • Local time: 10:34 AM
  • LocationMadrid, Spain

Posted 19 February 2020 - 05:04 PM

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



#8 seanbuff OFFLINE  

seanbuff

    Advanced Member

  • Members
  • 280 posts
  • Local time: 06:34 PM
  • LocationSydney, Australia

Posted 19 February 2020 - 07:15 PM

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

 

I believe that one comes from the Playback Reporting plugin



#9 pĆ¼nktchen OFFLINE  

pĆ¼nktchen

    Advanced Member

  • Members
  • 2523 posts
  • Local time: 10:34 AM

Posted 19 February 2020 - 07:22 PM

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" ;)


  • PenkethBoy likes this

#10 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4727 posts
  • Local time: 04:34 AM
  • LocationPeterborough, Canada

Posted 19 February 2020 - 07:50 PM

Excellent work! Well done sir!

#11 mhendu OFFLINE  

mhendu

    Member

  • Members
  • 20 posts
  • Local time: 03:34 AM

Posted 19 February 2020 - 10:54 PM

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, 20 February 2020 - 12:12 AM.


#12 bgx OFFLINE  

bgx

    Advanced Member

  • Members
  • 152 posts
  • Local time: 10:34 AM
  • LocationGermany

Posted 20 February 2020 - 10:04 AM

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, 20 February 2020 - 11:56 AM.


#13 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 4296 posts
  • Local time: 09:34 AM
  • LocationWarrington,UK

Posted 20 February 2020 - 12:17 PM

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 :) 



#14 OOmatrixOO OFFLINE  

OOmatrixOO

    Advanced Member

  • Members
  • 34 posts
  • Local time: 10:34 AM

Posted 20 February 2020 - 01:10 PM

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, 20 February 2020 - 01:43 PM.


#15 hstamas OFFLINE  

hstamas

    Advanced Member

  • Members
  • 631 posts
  • Local time: 04:34 AM

Posted 20 February 2020 - 01:58 PM

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.



#16 gillmacca01 OFFLINE  

gillmacca01

    Advanced Member

  • Members
  • 67 posts
  • Local time: 09:34 AM

Posted 21 February 2020 - 01:52 PM

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, 21 February 2020 - 02:50 PM.


#17 gillmacca01 OFFLINE  

gillmacca01

    Advanced Member

  • Members
  • 67 posts
  • Local time: 09:34 AM

Posted 21 February 2020 - 03:24 PM

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, 21 February 2020 - 03:25 PM.

  • Dibbes likes this

#18 Dibbes OFFLINE  

Dibbes

    Advanced Member

  • Members
  • 1231 posts
  • Local time: 10:34 AM
  • LocationMadrid, Spain

Posted 21 February 2020 - 05:39 PM

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, 21 February 2020 - 07:01 PM.


#19 PenkethBoy OFFLINE  

PenkethBoy

    Advanced Member

  • Members
  • 4296 posts
  • Local time: 09:34 AM
  • LocationWarrington,UK

Posted 21 February 2020 - 07:17 PM

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



#20 Dibbes OFFLINE  

Dibbes

    Advanced Member

  • Members
  • 1231 posts
  • Local time: 10:34 AM
  • LocationMadrid, Spain

Posted 22 February 2020 - 05:50 AM

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






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users