Luke 36997 Posted January 24, 2017 Share Posted January 24, 2017 well is it supposed to be a live stream, or not? Link to comment Share on other sites More sharing options...
pünktchen 1251 Posted January 24, 2017 Author Share Posted January 24, 2017 Yes, in theory. But i don't want to use a http stream but a file, because that's the only way a user can seek within the inprogress recording. It isn't funny if one has set a recording pre padding of 5 minutes or more and you always have to watch all the commercials before the show 1 Link to comment Share on other sites More sharing options...
Spaceboy 2492 Posted January 24, 2017 Share Posted January 24, 2017 ok, from my perspective using the latest plugin is actually a little worse. its certainly not better Previously the stream would always end when the file stops growing, not when it gets to the point where it was when playback started. now, it still continues past the file size it was when playback started but it ends before the end of the recording, the time it ends is more random though so its more difficult to predict. i can't see a link now though Link to comment Share on other sites More sharing options...
Spaceboy 2492 Posted January 26, 2017 Share Posted January 26, 2017 If there is nothing, it might be cheaper to have the plugin poll the tv server every 60 seconds and trigger the event if needed, then we can cache for long periods of time and react to change quicker....as opposed to the current 5 minute cache.I'd like to emphasise that whatever is going on its taking far longer than 5 mins, I'm looking at a program that finished over an hour and ten minutes ago and it's still not direct playable because the length hasn't been detected. This is at the extreme of what I see but 30 mins plus is regular Link to comment Share on other sites More sharing options...
pünktchen 1251 Posted January 28, 2017 Author Share Posted January 28, 2017 @@Luke back to your suggestion... What would be the next step if i poll the backend for timer or recording changes? You've talked about creating a custom event trigger so that only timer or recording data is refreshed. Some tips how to do this? Link to comment Share on other sites More sharing options...
pünktchen 1251 Posted January 29, 2017 Author Share Posted January 29, 2017 @@Spaceboy What version of the Emby Server do you have? Stable, beta or dev? This is really important, so i can give you some "dll's" to test! Link to comment Share on other sites More sharing options...
Spaceboy 2492 Posted February 4, 2017 Share Posted February 4, 2017 @@Spaceboy What version of the Emby Server do you have? Stable, beta or dev? This is really important, so i can give you some "dll's" to test!Hi puncktchen I'm on the beta server. Cheers! Link to comment Share on other sites More sharing options...
Spaceboy 2492 Posted February 15, 2017 Share Posted February 15, 2017 any further thoughts on this? i thought it was improving but i am sitting here 50mins + since a recording finished, waiting for it to be properly detected so it can be direct played Link to comment Share on other sites More sharing options...
pünktchen 1251 Posted February 15, 2017 Author Share Posted February 15, 2017 @@Luke back to your suggestion... What would be the next step if i poll the backend for timer or recording changes? You've talked about creating a custom event trigger so that only timer or recording data is refreshed. Some tips how to do this? @@Luke Link to comment Share on other sites More sharing options...
Luke 36997 Posted February 16, 2017 Share Posted February 16, 2017 What I would do is create a scheduled task, so you need a class that implements IScheduledTask. I can then show you how to hide it from the scheduled tasks config screen. Then configure the class with an interval trigger to run every 5 minutes. When a recording is active you could even run it every 30 seconds, but scheduled tasks don't have a way to let you adjust that on the fly. Anyhow, you'll get some data back from the tv server, compare it to data you had before, and if something has changed you can trigger the RecordingStatusChanged event. Link to comment Share on other sites More sharing options...
pünktchen 1251 Posted February 16, 2017 Author Share Posted February 16, 2017 Didn't you say that the RecordingStatusChanged event triggers a full guide refresh? That would really overshoot the target of refreshing recordings. Also is there an other plugin that uses events, because this is completely new for me!? 1 Link to comment Share on other sites More sharing options...
Luke 36997 Posted February 16, 2017 Share Posted February 16, 2017 No, that's the DataSourceChanged event. This one is for recordings only. 1 Link to comment Share on other sites More sharing options...
Luke 36997 Posted February 16, 2017 Share Posted February 16, 2017 You can check out trakt for a scheduled task example: https://github.com/MediaBrowser/trakt/tree/master/Trakt/ScheduledTasks Once you have that done trigger the event is the easy part. 2 Link to comment Share on other sites More sharing options...
Spaceboy 2492 Posted February 17, 2017 Share Posted February 17, 2017 All sounding excellent! Link to comment Share on other sites More sharing options...
pünktchen 1251 Posted March 5, 2017 Author Share Posted March 5, 2017 You can check out trakt for a scheduled task example: https://github.com/MediaBrowser/trakt/tree/master/Trakt/ScheduledTasks Once you have that done trigger the event is the easy part. So how to trigger the event? Link to comment Share on other sites More sharing options...
Luke 36997 Posted March 6, 2017 Share Posted March 6, 2017 try something like if (RecordingDataChanged != null) { RecordingDataChanged(this, EventArgs.Empty); } Link to comment Share on other sites More sharing options...
pünktchen 1251 Posted March 6, 2017 Author Share Posted March 6, 2017 With "EventArgs.Empty" i get an error "cannot convert from 'System.EventArgs' to 'MediaBrowser.Controller.LiveTv.RecordingStatusChangedEventArgs'"?! So i've tried something other (don't know what i'm doing): public void CheckRecordingStatus(CancellationToken cancellationToken) { int currentActiveRecordings = Plugin.TvProxy.GetActiveCards(cancellationToken).Count(c => c.IsRecording); if (currentActiveRecordings != lastActiveRecordings && currentActiveRecordings > 0) { RecordingStatusChangedEventArgs args = new RecordingStatusChangedEventArgs(); args.NewStatus = RecordingStatus.New; args.RecordingId = "123"; RecordingStatusChanged(this, args); } lastActiveRecordings = currentActiveRecordings; } public event EventHandler<RecordingStatusChangedEventArgs> RecordingStatusChanged; But now i get a System.NullReferenceException right at "RecordingStatusChanged(this, args)" Link to comment Share on other sites More sharing options...
Luke 36997 Posted March 6, 2017 Share Posted March 6, 2017 that code looks good, but just make sure to always check RecordingStatusChanged for null. Link to comment Share on other sites More sharing options...
pünktchen 1251 Posted March 6, 2017 Author Share Posted March 6, 2017 But nothing happens then Link to comment Share on other sites More sharing options...
Luke 36997 Posted March 7, 2017 Share Posted March 7, 2017 The only thing it does in the core is reset a value so that the next time the UI requests recordings, they are refreshed from the back end. Can you confirm that? thanks. Link to comment Share on other sites More sharing options...
pünktchen 1251 Posted March 7, 2017 Author Share Posted March 7, 2017 Aah, that's interesting! Will check this later. If it's working, than only one question is left: How to hide the task? Link to comment Share on other sites More sharing options...
Luke 36997 Posted March 7, 2017 Share Posted March 7, 2017 have the scheduled task also implement IConfigurableScheduledTask Link to comment Share on other sites More sharing options...
pünktchen 1251 Posted March 13, 2017 Author Share Posted March 13, 2017 @@Spaceboy Back at home? Do you want to test something? Link to comment Share on other sites More sharing options...
Spaceboy 2492 Posted March 16, 2017 Share Posted March 16, 2017 @@Spaceboy Back at home? Do you want to test something? hi, yes i'm available to test if you have something. cheers Link to comment Share on other sites More sharing options...
pünktchen 1251 Posted March 26, 2017 Author Share Posted March 26, 2017 Sorry!!! It took longer than expected, but here's something: I've created two hidden tasks. One of these is always enabled and checks every minute if the number of recordings has changed. If yes, then RecordingStatusChanged event is triggered and hopefully your recordings get refreshed with mediainfo. The other task is only enabled if you have enabled "caching of timers" in the advanced plugin settings. This task runs every 15 minutes to refresh and cache all timers. I've completely overhauled the caching and you should see great performance improvements in every screen, especially if you have lots of schedules. Also there's a new setting in the program options of the plugin to use channel logos as program images. At least there's a new setting in the recording options that i could not test that much because the Android TV app shows some strange values when trying to seek. And of course the attached version has some fixes for bugs that nobody ever noticed Please test all aspects of the plugin. Playback of tv, finished and inprogress recordings. Timer creation, modification and deletion. Just everything 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now