MediaBrowser / Emby

Emby Server is a personal media server with apps on just about every device.
https://emby.media
GNU General Public License v2.0
4.1k stars 801 forks source link

Support smart views/playlists #1143

Open LukePulverenti opened 9 years ago

LukePulverenti commented 9 years ago

Design a standalone c# portable class library that parse Kodi smart playlists into an object. Also provide the ability to modify the object and write it back to the original file.

ShanePe commented 7 years ago

Hi Luke, I would like to tackle this one if you still need it, it's my first open source contribution but have been developing for years.

LukePulverenti commented 7 years ago

Hi @ShanePe thanks, I can help you get started. Can you refresh my memory on one thing. Where does Kodi store smart playlist definitions? Is it in the database or an nfo? Thanks.

ShanePe commented 7 years ago

Hi Luke,

They are a in plain text files (.xsp), I've had a run through the documentation (http://kodi.wiki/view/smart_playlists) and won't be tricky to do, as I said, first time getting involved in open source DEVELOPMENT AND would really like to help. Would I create a git repo for the stand alone library and you pull from it or would I clone your repo and include it in there, and what about naming conventions, any help would be greatly appreciated.

Looking forward to doing it.

Thanks again, Shane.

On 11 Jan 2017 8:07 PM, "Luke" notifications@github.com wrote:

Hi @ShanePe https://github.com/ShanePe thanks, I can help you get started. Can you refresh my memory on one thing. Where does Kodi store smart playlist definitions? Is it in the database or an nfo? Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MediaBrowser/Emby/issues/1143#issuecomment-271979332, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRyyULKkUmL7Rn5Jk48ELNVOUdXwmtPks5rRTaGgaJpZM4Fedp8 .

LukePulverenti commented 7 years ago

Hi Shane. I would imagine we would adopt the same kind of approach as XmlTV. What we did there was create a standalone class library and I think that's a good way to go here. So you'd start by creating a library that can read the xsp to an object, as well as save the xsp back to a file. You can define the object inside the library. Once we have the library, then we can look at deciding how Emby Server will make use of it. You'll also want to make sure it has unit tests along with some sample files.

The only part that's somewhat of a pain is that it needs to be a PCL targeting Win 8.1/.NET 4.5. That is really the best approach right now for dual compatibility with .NET and .NET Core.

That means file system access won't be available, so you'll want to have the library just work with a Stream. The unit test project can then use the full .net 4.5 framework and can pass in a FileStream. Let me know if this helps. Thanks.

ShanePe commented 7 years ago

Perfect, then I'll name name it kodi.smartlist.parser for now, once I'm done, do I just zip up the code and send it along to you?

On 11 Jan 2017 9:04 PM, "Luke" notifications@github.com wrote:

Hi Shane. I would imagine we would adopt the same kind of approach as XmlTV. What we did there was create a standalone class library and I think that's a good way to go here. So you'd start by creating a library that can read the xsp to an object, as well as save the xsp back to a file. You can define the object inside the library. Once we have the library, then we can look at deciding how Emby Server will make use of it. You'll also want to make sure it has unit tests along with some sample files.

The only part that's somewhat of a pain is that it needs to be a PCL targeting Win 8.1/.NET 4.5. That is really the best approach right now for dual compatibility with .NET and .NET Core.

That means file system access won't be available, so you'll want to have the library just work with a Stream. The unit test project can then use the full .net 4.5 framework and can pass in a FileStream. Let me know if this helps. Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MediaBrowser/Emby/issues/1143#issuecomment-271993865, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRyycp9nJiuWMYvsWzUgh-NIOtojkZ8ks5rRUPogaJpZM4Fedp8 .

LukePulverenti commented 7 years ago

What you can do is create a github repository with your own account along with an MIT license, or something similar. Then we can just fork it and our repository will just be a fork of ours. If you don't want to have a public repository then yes you can zip it up and we'll just create it under ours. Thanks !

ShanePe commented 7 years ago

Great, I'll create a public repo. I'll let you know when it's ready.

Thanks again, looking forward to it.

On 11 Jan 2017 9:53 PM, "Luke" notifications@github.com wrote:

What you can do is create a github repository with your own account along with an MIT license, or something similar. Then we can just fork it and our repository will just be a fork of ours. If you don't want to have a public repository then yes you can zip it up and we'll just create it under ours. Thanks !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MediaBrowser/Emby/issues/1143#issuecomment-272007214, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRyyQEutQ8P5v21lmD_u0JE0VKXSyjTks5rRU9EgaJpZM4Fedp8 .

ShanePe commented 7 years ago

Hey Luke,

I've complete the portable library, I have included tests and a sample app to demonstrate library use, Let me know what you think, or any enhancements.

https://github.com/ShanePe/Kodi.Utilities

On Wed, Jan 11, 2017 at 9:54 PM, Shane Pennicott shane.pennicott@gmail.com wrote:

Great, I'll create a public repo. I'll let you know when it's ready.

Thanks again, looking forward to it.

On 11 Jan 2017 9:53 PM, "Luke" notifications@github.com wrote:

What you can do is create a github repository with your own account along with an MIT license, or something similar. Then we can just fork it and our repository will just be a fork of ours. If you don't want to have a public repository then yes you can zip it up and we'll just create it under ours. Thanks !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MediaBrowser/Emby/issues/1143#issuecomment-272007214, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRyyQEutQ8P5v21lmD_u0JE0VKXSyjTks5rRU9EgaJpZM4Fedp8 .

LukePulverenti commented 7 years ago

Perfect, thanks ! How are these handled in the user's file system? Is it a matter of creating a smart playlist in the UI and the xps gets saved to an internal location...or can users create their own and put the xsp's anywhere they like, perhaps with images and fanart just like a video file?

ShanePe commented 7 years ago

Hey Luke,

Kodi probes it's UserData/Playlist directory, so playlist (.xsp) would need to be saved there, I have extended the Save functionality, to be able to drop the file to a file system, but being my first 'Portable' class lib, this was a bit tricky, so use an nget package called PCLStorage, which supports the requirements.

Just a question, how'd you get to target soooo many different platforms, it's quite impressive, I run linux (ubuntu/mint) at home and was using serviio (but gonna move over to EMBY for obvious reasons :), is the linux version mono based?

Also, is that data store mysql ? I have Kodi integrating with Serviio via JDBC (Derby/My SQL), basically keeping the two libraries and metadata in sync, which is a pain, I use a few Pis and Fire stick that support Kodi and some devices that don't, (Hence serviio and DLNA)... Anyhoo rambling...

if there is anything else you need help with, I would really dig getting involved.

Take care Shane.

On Thu, Jan 26, 2017 at 7:21 AM, Luke notifications@github.com wrote:

Perfect, thanks ! How are these handled in the user's file system? Is it a matter of creating a smart playlist in the UI and the xps gets saved to an internal location...or can users create their own and put the xsp's anywhere they like, perhaps with images and fanart just like a video file?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MediaBrowser/Emby/issues/1143#issuecomment-275323053, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRyyVYC32i3ISUSYJlu2DpAFbz-EHpFks5rWEmDgaJpZM4Fedp8 .

LukePulverenti commented 7 years ago

Minimizing dependencies is the key to multi-platform support. So on that note, would you mind removing the PCL third party library and just having the class work with a Stream? If you don't want to, that's fine, I'll do it when we fork this. But since we already have our own file system interfaces we will want to use those to resolve a path into a Stream.

Also, question, does Kodi always display smart playlists as a text-based list. What if you wanted a smart playlist to have a poster, does it support customizing that, or is it auto-generated based on the media?

ShanePe commented 7 years ago

Hi Luke, no problems, I'll remove it, I haven't seen anything is kodi code that supports posters and such. It all seems to be self contained within the xml. But I'll do some. More digging.

On 26 Jan 2017 8:45 PM, "Luke" notifications@github.com wrote:

Minimizing dependencies is the key to multi-platform support. So on that note, would you mind removing the PCL third party library and just having the class work with a Stream? If you don't want to, that's fine, I'll do it when we fork this. But since we already have our own file system interfaces we will want to use those to resolve a path into a Stream.

Also, question, does Kodi always display smart playlists as a text-based list. What if you wanted a smart playlist to have a poster, does it support customizing that, or is it auto-generated based on the media?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MediaBrowser/Emby/issues/1143#issuecomment-275508283, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRyyfNIEDcw_T0KIfDc2nbRMt1gTJKgks5rWQXlgaJpZM4Fedp8 .

ShanePe commented 7 years ago

Also... If you have a look at the code, the Pcl store is just a wrapper that calls the stream load. So really easy to remove.

On 26 Jan 2017 8:56 PM, "Shane Pennicott" shane.pennicott@gmail.com wrote:

Hi Luke, no problems, I'll remove it, I haven't seen anything is kodi code that supports posters and such. It all seems to be self contained within the xml. But I'll do some. More digging.

On 26 Jan 2017 8:45 PM, "Luke" notifications@github.com wrote:

Minimizing dependencies is the key to multi-platform support. So on that note, would you mind removing the PCL third party library and just having the class work with a Stream? If you don't want to, that's fine, I'll do it when we fork this. But since we already have our own file system interfaces we will want to use those to resolve a path into a Stream.

Also, question, does Kodi always display smart playlists as a text-based list. What if you wanted a smart playlist to have a poster, does it support customizing that, or is it auto-generated based on the media?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MediaBrowser/Emby/issues/1143#issuecomment-275508283, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRyyfNIEDcw_T0KIfDc2nbRMt1gTJKgks5rWQXlgaJpZM4Fedp8 .

ShanePe commented 7 years ago

Hi Luke, I have removed the dependency. Let me know if there is anything else you need...

Take care Shane.

On Thu, Jan 26, 2017 at 9:07 PM, Shane Pennicott shane.pennicott@gmail.com wrote:

Also... If you have a look at the code, the Pcl store is just a wrapper that calls the stream load. So really easy to remove.

On 26 Jan 2017 8:56 PM, "Shane Pennicott" shane.pennicott@gmail.com wrote:

Hi Luke, no problems, I'll remove it, I haven't seen anything is kodi code that supports posters and such. It all seems to be self contained within the xml. But I'll do some. More digging.

On 26 Jan 2017 8:45 PM, "Luke" notifications@github.com wrote:

Minimizing dependencies is the key to multi-platform support. So on that note, would you mind removing the PCL third party library and just having the class work with a Stream? If you don't want to, that's fine, I'll do it when we fork this. But since we already have our own file system interfaces we will want to use those to resolve a path into a Stream.

Also, question, does Kodi always display smart playlists as a text-based list. What if you wanted a smart playlist to have a poster, does it support customizing that, or is it auto-generated based on the media?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MediaBrowser/Emby/issues/1143#issuecomment-275508283, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRyyfNIEDcw_T0KIfDc2nbRMt1gTJKgks5rWQXlgaJpZM4Fedp8 .

LukePulverenti commented 7 years ago

Hi Shane, Just for an update, the only holdup here is our ability now to do the UI work needed for this. I'm starting to think about how that will impact or change screens we currently have. Thanks.

ShanePe commented 7 years ago

No worries... let me know if I can help... or if you need any help else where.

Thanks so much

On 25 Feb 2017 9:27 PM, "Luke" notifications@github.com wrote:

Hi Shane, Just for an update, the only holdup here is our ability now to do the UI work needed for this. I'm starting to think about how that will impact or change screens we currently have. Thanks.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MediaBrowser/Emby/issues/1143#issuecomment-282513654, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRyyS0946DoYmEzSNUvlgHUfWIa9CECks5rgJzUgaJpZM4Fedp8 .

LukePulverenti commented 7 years ago

That would actually be fantastic. Are you in the Emby community? Can you send me a PM there? Thanks !

ShanePe commented 7 years ago

I'm not... how do I go about it... just sign up?

On 26 Feb 2017 9:58 PM, "Luke" notifications@github.com wrote:

That would actually be fantastic. Are you in the Emby community? Can you send me a PM there? Thanks !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MediaBrowser/Emby/issues/1143#issuecomment-282591351, or mute the thread https://github.com/notifications/unsubscribe-auth/ADRyyUJ6cwqIW9N1bBca8u48Dbr7w_L-ks5rgfWEgaJpZM4Fedp8 .

LukePulverenti commented 7 years ago

Yea, exactly.

artorius commented 6 years ago

Is this feature still being worked on? This is the one killer enhancement that I would love to see.

LukePulverenti commented 6 years ago

Yes we are still planning on this for the future. thanks.