vexorian / dizquetv

Create live TV channels from your own media. Access the streams using the simulated HDHomerun tuner or the generated M3U URl.
zlib License
1.45k stars 93 forks source link

Channels Based on Smart Playlists with Auto Update #10

Open d8ahazard opened 4 years ago

d8ahazard commented 4 years ago

Hey there! Glad to see someone ran with pseudoTV.

So, I had this request open there, hopefully, you can make it a reality.

Basically, I want to create a bunch of smart playlists based on genre. Action, adventure, comedy, drama, etc.

I want to make a bunch of channels in DizqueTV, ideally, by just naming the playlists DizqueTV - Action, DizqueTV - Adventure, etc. and having them auto-detected.

If not, I'm cool with auto-creating the initial channels.

Once the channels exist - I want the playlists to auto-update...somehow. Either auto-trigger it every time the library is rescanned, or do it every hour or something. This way, new action movies just magically appear on the action channel. New adventure in the adventure channel, etc.

Can you make this happen??

vexorian commented 4 years ago

This is actually the first next big feature I'll add after the first stable release

It will be called Auto-tune channels. So the current channel UI will be "static channels" or something like that. In auto-tune channels, you pick a playlist for content, a playlist for filler and some options regarding padding and shuffling and then the channels will keep refreshing themselves with the contents of the playlists.

d8ahazard commented 4 years ago

That is sexy AF. I think you may be my new favorite person on the interwebz. One additional feature of this that I just came up with would be some way to auto-set the channel icon based on the name/genre? So, if I make a zip or something of png files named "drama.png" "action.png", "comedy.png" and upload it, the app automagically sets the right icon if it recognizes the genre name?

I think there used to be "standard" sets of genre icons, if you're interested, I can find them for reference if you want.

psybertech commented 3 years ago

Is this still planned?

I've started making and converting all my Plex playlists as "smart" in hopes that dizQ could simply add a playlist by name and then, somehow, just run with it.

i.e., check for new content when the current channel reaches it's end (guide-wise), check the smart playlist again, add any new items (or remove deleted ones) and finally re-shuffle based on the current channel's shuffle type (if exists) before building the start of the new rotation. I know the channel doesn't currently save the shuffle type and options currently, but I really would love to see this type of interaction happen. :)

This really becomes a 'set it and forget' feature that I really am craving from a maintenance standpoint as I have hit 100 channels now and often do stupid things like rename files or folders. Plus adding new episodes to shows and adding new movies, or upgrading versions happen more often than I'd like to admit. :D

Anyway.... +1 for this * 1000000!

j

vexorian commented 3 years ago

At the moment the emphasis is going to be towards empowering the script tools so that it is possible to automatize this process if you want.

But as for making it a native feature, there are issues with it, the main issue is that every single person on earth seems to have a different idea of how the programming should look like. And making a one size fit-all feature is pretty difficult. There might eventually be something that allows this to work with just generating random channels. But if you want to make a channel, that automatically fetches stuff from plex, and then it creates the perfect lineup with fixed starting times for each show and all that stuff, then that's what scripting is for.

psybertech commented 3 years ago

I understand that there is no one size fits all for sure.

I have used the python api playlist to channel scripts a ton and they do work well.

A few issues with it though... Since it is run on demand, that means I have to schedule it. Even scheduling runs late overnight has issues for me since I can't guarantee that at 4AM no on is watching.

Scripting use observations... Once a playlist to channel script it is run, the channel will completely change (expected & understood of course), and in my experience, for it to always work well, I have to restart dizQ to make sure it really applies. Perhaps this isn't needed now, but I had better results doing so. In my script, I update all channels and then before exit, trigger the restart once, not after each update like a madman. :) I then also trigger an API call on Emby to update the guide, but, things aren't quite perfect and can take a little time to complete.

So, while all this happens as expected, this does at least three things to the potential user experience:

  1. a restart stops the user's playback if they are watching dizQ (only tested on Emby clients) ---- if no restart of dizQ happens, I think the current item will play out fine, but when the next item starts, it won't be what the guide says and won't start from the beginning and just start off in progress of where ever the dizQ guide is at - if at all - I haven't tested this to be fair
  2. when the user then just hits play again after the stop from a dizQ restart, unaware of a full on channel reprogramming, from where they just were a few seconds ago, it will start on an entirely different item, not the one they were just watching and at some start point which will appear completely random to them
  3. also when they restart, the guide isn't refreshed yet, so it shows the old schedule, which will be updated relatively soon, but it will be off - and it will not just be that channel, but any channel that is done on the update schedule, so for me, pretty much all of them will completely messed up for users until their guides sync back up... which can be only after an exit and restart of Emby (i.e. in the case of Fire TV and Emby clients - otherwise it takes a very long time after Emby's back completed the update - I wish it was instantaneous like on the web ui).

If other clients don't immediately halt on a dizQ exit, then they still would be faced with (2) and (3) until their guides sync'd up, but I am pretty sure (1) would happen soon.

But it does introduce a bad user experience. Granted, it would be, at least for me, once a day or every few days, and very late at nite, but it isn't great.

Also, running my current concept needs a ton of refinement to get better results.

I'd have to split up all my channels to figure out which ones should be done on what schedule... i.e., if there is only 24 hours of content, safe to run for a daily update. If there are 3 days worth, run every 3 days, 5 days run every 5, etc. But I really would have to do a ton of maintenance on it. all to get the most out of larger channels with less possible repeats during their programming run.

If I just leave it as I am currently toying with and run it all on a one size fits all scripting approach of say, every two days, some channels would never reach their end of programming and could end up repeating a ton of things over and over again without ever playing a ton of items.

But... I will continue to play. I love it, it is fun to figure out, but at the end of the day, for this kinda feature, I'd really like some backend auto-config if it is ever possible, even on some level.

Thanks for reading (if you made it this far), vex! Sorry... long winded as usual.

j

vexorian commented 3 years ago

If you are using the rest endpoints to modify the channels, then it should absolutely not be necessary to restart dizquetv. If it is, then please report it as a bug.

when the user then just hits play again after the stop from a dizQ restart, unaware of a full on channel reprogramming, from where they just were a few seconds ago, it will start on an entirely different item, not the one they were just watching and at some start point which will appear completely random to them

But see, whenever I bring up that auto-tune channels were going to be very hard to understand, most people assume it is just updating the playlist. But in reality, this would be a concern if I had to make it a native feature. And updating the channel with new programming without messing up with the existing tv guide is HARD. That's the reason I would call this a long-term goal rather than the next thing to implement.

But I need you to stand back at gaze upon the incredibly big list of requirements your use case implies.

Now I understand that a lot of your problems could be fixed if :

psybertech commented 3 years ago

Got it.... You are active in discord atm, so I might bring a few things up there, but... Setting restarting dizQ aside for the moment (might not be necessary, it was for consistent results weeks ago before any 1.1x builds I was using)...

vex: First of all, I need some sort of daemon scheduled to continuously get new content from plex. me: I don't see that as necessary... my brain: just when the XMLTV update runs, check if we are near or at end of content (-or- maybe a new pair of offset settings [i.e. on XMLTV update, refresh channel data if less than X hours remain in current channel list && only if after XXX-AM so not to disturb normal users] ) and if so ,rather than replay the same old rotation, then do XXXX (use saved shuffle options, get a current version of playlists, etc) and if necessary, don't worry about logic,, just dump the old and re-add it or append or whatever, depending on what the options are (smart playlist = dump | static list, reshuffle and be done, etc.) - rudimentary , yes, but in my head that is what I am thinking. There is a ton of room for refinement here, but again, I always go with my basic thinking... add channel, add content, hit shuffle and watch... the other options may be more complex to work out for sure, but on a simple channel creation and use, to me, this would be fantastic. It would limit admin time to only a few channels that are highly tweaked that can't just auto do XXXX. Again... just thoughts...........

vex: it has to be done with zero downtime. me: agreed...as close to as possible... and hiccups are to be expected for sure! too many possible scenarios to cover for sure. I don't care if the automated routine takes a long time to complete, but once it is ready, then be quick. So, rebuild the channels and the guide without impacting playback at that point in time. If something is playing and the schedule changes, well, play out the current item until the end, and then pick up where the channel should be... but yes, there could be user issues still. i.e... everything updates behind the scenes, the item the user is watching just keeps going as expected, but BAM, then next item is not correct to their guide and whatever... but your points below kinda address that... maybe a "pardon this interruption" message or "channel is being updated/your guide data is out of date, please close and restart, sorry, please try again" image/video could help at times... and yes.. I see the complexity of this all! haha man, the more I type....................... ;)

vex: And it somehow has to be notified correctly to emby me: that would be a great option! but to be honest and fair, not a requirement... Emby may not react to guide updates the same as other clients, but I am sure the XMLTV data for any client would need an indication to update on demand, but that could be difficult for all unless it was just a generic option to "call api of your server's xmltv data" with a simple overall dizQ option to save a complete url (which I would welcome!!) - and may not work for all clients for a ton of reasons... but I wouldn't want to call it every time XMLTV data is updated via dizQ on a per-channel basis, so a global option could work?.

vex:: And it has to be configurable so that every user can have the exact kind of programming they expect to have. me: to a point, yes... but most of the options now are just variants of a type of shuffle, so when you choose any shuffle type, they are predictable to a point... and unless you "pre-approve" the initial shuffle so it looks OK for that first time, it still is just a shuffle. So it re-shuffling based on your channel's 'saved' preference without you looking the next time, it will still be calculated off the same algorithm. So aside from a preview aspect when manually setting it up, i.e. if I wanted cyclic shuffle, the next "re-up" of the channel's content once the initial programming runs dry, it will be the same, but hopefully this time in a new order. Same should apply for all the shuffles.

AND ALL OF THE ABOVE doesn't think of flex at all, but I don't use it at all and I am not sure on the impact, but I think it should be applicable with my thoughts?

OK... done for now......... again... don't worry about my restarts of dizQ.... I will revisit all the scripting again over the weekend. Its been a couple weeks since I used the scripts and will try again after I update everything and make some backups and snapshots before testing. :)

OK... back to drinking and some discord time :D

j