manuelm / pvr.dvbviewer

Kodi's DVBViewer client addon
GNU General Public License v2.0
5 stars 3 forks source link

Support recording timer types #23

Closed popy2k14 closed 6 years ago

popy2k14 commented 6 years ago

The addon lacks on support of timer types, so you can select an series from epg record all upcoming shows off the same name.

Would be nice if this feature will be integrated.

popy2k14 commented 6 years ago

@manuelm: Does your latest commit (timer rework: https://github.com/manuelm/pvr.dvbviewer/commit/2b5a83523a0ce1cc2cec6cbf4a211a4f5e4c78b4) add the "Suchvorgaben" feature (record the same show based on the title) in the plugin?

manuelm commented 6 years ago

No. Otherwise this issue would have been closed.

The new timers makes recordings even worse. They are not visible in the EPG guide anymore and I doubt I can do anything about that.

popy2k14 commented 6 years ago

ok, thx for the info, maybe @ksooo can help with this. For testing, just contact me.

ksooo commented 6 years ago

I'm afraid you will need to debug Kodi yourself to learn why your timers do not show up correctly. Other add-ons have no problems with that.

Sorry, I have no test environment for dvbviewer and pure brain debugging is sooooooooooo time consuming. ;-)

manuelm commented 6 years ago

Yeah, I understand that. I just wanted to rule out that this is by design. i.e. new timers must have the epg uid set.

Can you point me to a file where I should start looking? I already looked at CFileItem but that basically leads me to everywhere :-)

manuelm commented 6 years ago

Btw I already looked at other PVRs as this is the first thing I do before asking for help. All PVRs I looked at make use of the epg uid field for non-manual timers.

manuelm commented 6 years ago

@popy2k14 You can download the new version for windows on https://ci.appveyor.com/project/manuelm/pvr-dvbviewer - I'll work on epg based timers after EDL as EDL is less work.

manuelm commented 6 years ago

@popy2k14 You can test auto timers now: https://ci.appveyor.com/project/manuelm/pvr-dvbviewer/build/master-132c1f3

popy2k14 commented 6 years ago

@manuelm: have downloaded the x64 version of your plugin and when i am install it in my "KodiSetup-20180602-b5181d72-master-x64.exe" installation, kodi says: Cannot load addon.

The log says:

14:21:51.498 T:9640 ERROR: Win32DllLoader::Load: Failed to load "C:\Users\popy\AppData\Roaming\Kodi\addons\pvr.dvbviewer\pvr.dvbviewer.dll" with error 126: "Das angegebene Modul wurde nicht gefunden. " Any hints? Was there an PVR api update?

manuelm commented 6 years ago

I assume this is debug build related. I'll disable debug build and trigger a rebuild.

Was there an PVR api update?

Yes, today. But you are using an older nightly and a compatible PVR.

manuelm commented 6 years ago

hm, ofc. rebuilding will pull in the new PVR API update as part of the dependencies.. :/

manuelm commented 6 years ago

Please try those: https://ci.appveyor.com/project/manuelm/pvr-dvbviewer/build/test-65dc9a5

However before updating/installing the zip, you have to modify the file pvr.dvbviewer/addon.xml and change <import addon="kodi.binary.instance.pvr" version="5.10.0"/> to <import addon="kodi.binary.instance.pvr" version="5.9.0"/>

popy2k14 commented 6 years ago

have now updated my kodi on my test machine to "KodiSetup-20180609-5da94d19-master-x64.exe" and installed your addon. The following i have tested:

Tumbs up for this and many thanks!!!!

I have noticed a few drawbacks which would be fine gets sorted. The following settings in the created auto timer does'nt get set to DMS defaults (like set in the DMS default recording settings), they are:

PS.: Just an idea, if these setting are not available in the pvr api, we could consider provide those globally with the addon settings.

Dont get me wrong that's just suggestions to make it usable and get rid of creating auto timers with DMS :-) Really Really nice work you are doing to bringing the complete DMS features into kodi!

pOpY

manuelm commented 6 years ago

Dont know if it's relevant, but the created one shot timers (from auto timer) was not deleted. Maybe thats the behavour of DMS.

Yes. In DMS there is actually no real connection between auto timers and timers after they are created. E.g. if you rename an autotimer the reference in the timers list does not get renamed. Kodi just displays an general message upon deletion. Neither DMS nor the PVR itself deletes child timers.

Regarding the wrong or missing default values: will check this next week.

Regarding missing features: Kodi supports custom attributes but they are no multi select. So I'd have to provide 2**x different combinations which is not going to happen. Maybe @ksooo has an idea regarding this. Maybe an additional interface to provide an custom gui xml which gets appended and it's values pushed back to the PVR.

popy2k14 commented 6 years ago

No problem regarding the auto and child timers. Just wanted to say you my test results. I would say, this is just as it is :-)

Thx, regarding missing default values, take your time. Dont know what you mean regarding the missing features. If you mean check epg and deactivate auto timers, thanill think just two global addon settings would be sufficient.

See my picture...

additional_settings

pOpY

manuelm commented 6 years ago

Post action is not set to default Post task is not set to default

Checked Post record action. Gets set to default.

Priority is fixed with https://github.com/manuelm/pvr.dvbviewer/commit/3894af288c172321077733f8eb3c7fd26693eb81

If you mean check epg and deactivate auto timers, thanill think just two global addon settings would be sufficient.

Global settings are the worst of all solutions. Won't do this. These 4 knobs would result in 16 different possible states. I think for now I won't add them at all until a better solution is available.

manuelm commented 6 years ago

However we could talk about changing the default values. e.g I don't have hard feelings about enabling "Additionally check against recording timers" all the time. "Additionally check against removed recordings" is already enabled per default.

Regarding the remaining two knobs: I could add those as custom properties. Three different states seems ok. Especially as all three are related to each other.

popy2k14 commented 6 years ago

Checked Post record action. Gets set to default.

What do you mean with that, is this fixed? In my case when i'll create an auto timer, my default post recording task "Post-Aufnahme" is not set in the auto timer and also not at the created child timers. Here are pictures:

DMS default settings: 1 dms_recording_defaults

DMS auto timer created with kodi: 2 dms_auto_timer_created with kodi

dms child timer created from auto timer: 3 dms_child_timer_created from autotimer

Thanks for fast the priority workaround/fix. I have seen that kodi has priorities (high, normal, ...) would'nt it be better to just use these and convert it to DMS compatible values (normal = 50, ...)?

Dont know what you mean with the combinations of the 4 knobs. I dont mean enabling these all the time. Just let the user decide with global or better custom properties (which will be shown on creation of every auto timer). When ill got you right, knobs (radio buttons) shouöd be possible, right?

A really clear solution would be, if there are 4x global knobs, these will be set as default for the custom timer properties every time one gets created. So user can change it (yes/no) and the auto timer will be created with this settings.

manuelm commented 6 years ago

What do you mean with that, is this fixed?

I cannot reproduce this. Here the default value gets set. And even if not it's a bug in the DMS. I do not touch the values at all.

When ill got you right, knobs (radio buttons) shouöd be possible, right?

Yes, but as already explained they are single select only. No multi select. So providing 4 different settings results in 16 different items/states. I won't do this.

I'll go forward with always enabling "Additionally check against recording timers" and provide three different items/states for the two remaining deduplication settings. That's the best solution I can think of. And I won't do global settings.

manuelm commented 6 years ago

Thanks for fast the priority workaround/fix. I have seen that kodi has priorities (high, normal, ...) would'nt it be better to just use these and convert it to DMS compatible values (normal = 50, ...)?

Those are defined by me. I'm mapping them to integer values in the specific range. The normal timer API supports setting the user default value by passing -1. The auto timer API doesn't. So I'm hardcoding this for now.

manuelm commented 6 years ago

I cannot reproduce this.

So I checked for AfterProcessAction as well. Here no value gets set. According to the documentation this is ok as empty/no value means no action. However I can't do anything about this.

Edit: Ok, I found a way to work around this. Might take a little longer to fix as it's more work/code then setting a magic value.

popy2k14 commented 6 years ago

I cannot reproduce this. Here the default value gets set. And even if not it's a bug in the DMS. I do not touch the values at all.

hm, here it gets set to "Keine" but in settings i have one set (Post-Aufnahme). Updated DMS to 2.1.1 but that did not solve the issue. I am also using emby and the dvbv addon, and when creating an auto timer directly in emby it works. In emby there is an addon option where you can enter a string. I have entered "Post-Aufnahme" and there it works.

You said you dont even touch the "post recording task" values, maybe this is the issue? I have looked in the sources from emby dvbv addon on github and there is a "after" statement in the api which seems to set this value, here is the line:

builder.AppendFormat("after={0}&", !String.IsNullOrWhiteSpace(Configuration.TimerTask) ? Configuration.TimerTask.ToUrlString() : String.Empty);

from here: https://github.com/puenktchen/DVBViewerTVPlugin/commit/bd8f43bb8bce26f9e29f3ab597056b9785d64e67 at file "AutoCreateTimersTask.cs"

Here a global string setting would be nice.

ok, now ill got you regarding priority and the 4x knobs. Your explanation looks good to me also.

manuelm commented 6 years ago

@popy2k14 Please give https://ci.appveyor.com/project/manuelm/pvr-dvbviewer/build/master-8bcae0a a try. All remaining points should be fixed. Unless you find more bugs I'll push/publish the autotimers this weekend.

popy2k14 commented 6 years ago

@manuelm have tested the new version with the following results.

The default "after" task will sadly not be set for me, see:

dvbv_1

I have looked into the code and seen that line:

params += "&AfterProcessAction=" + URLEncode(m_cli.GetSettings().m_recordingTask);

should'nt that be "&after=" as seen on my above content (stolen from embys dvbd addon)?

The option to prevent similar episode recordings works as it should. A nice addition would be that the user can select an default which will be used for the auto timer dialog in kodi. Can you please implement such a feature? (I am speaking for my wife, she doesnt want to fiddle around with such options -> press create timer -> ok and go)

manuelm commented 6 years ago

The default "after" task will sadly not be set for me

Check out the debug log to see what the PVR is sending.

should'nt that be "&after=" as seen on my above content (stolen from embys dvbd addon)?

No. You're mixing the autotimers/epg search and timers interface.

A nice addition would be that the user can select an default which will be used for the auto timer dialog in kodi.

The PVR will use the default action defined in the DMS settings dialog. That's good enough. If you want to change the action you can do this using the webinterface or another tool.

popy2k14 commented 6 years ago

Heres the link to the api: http://en.dvbviewer.tv/wiki/Recording_Service_web_API#.2Ftasks.html.3Ftask Search for "after=":

timeradd_after

popy2k14 commented 6 years ago

@manuelm ill see, you are using /api/searchadd.htm rather than /api/timeradd.html. In the searchadd.htm, the "&AfterProcessAction=" is correct as stated here: https://www.dvbviewer.tv/forum/topic/59621-media-server-2x-api-changes/

Where do you get the value for this parameter? Because in my case its empty. Here is the call to DMS when creating a timer:

20:43:30.852 T:2924 DEBUG: CurlFile::Open(0x1cc63976570) http://192.168.0.5:8089/api/searchadd.html?EPGBefore=5&EPGAfter=5&Days=127&SearchFields=3&AutoRecording=1&CheckRecTitle=0&CheckRecSubtitle=0&SearchPhrase=Snowpiercer&Name=Snowpiercer&RecordingFolder=Auto&CheckTimer=1&AfterProcessAction=&Priority=50&Channels=281480000327207&StartTime=&EndTime=&StartDate=-1.00.1899

popy2k14 commented 6 years ago

you are getting the variable "m_recordingTask" with the call to "api/getconfigfile.html?file=config%%5Cservice.xml"the %5 should be a slash which would be in my case

http://192.168.0.5:8089/api/getconfigfile.html?file=config%\service.xml

When ill enter this ill get 404, i have to remove the second % So when i'll enter in my browser:

http://192.168.0.5:8089/api/getconfigfile.html?file=config\service.xml

i'll get a correct answer.

Could this be the issue?

manuelm commented 6 years ago

From api/getconfigfile.html?file=config%5Cservice.xml -> /Recording/entry/[@name=DefTask]

When ill enter this ill get 404, i have to remove the second %

No. See man 3 printf

I'll check this out myself. Haven't tested this at all. Just assumed I got it right.

popy2k14 commented 6 years ago

you are right, the string for the request is correct. No problem, i am here to test again.

manuelm commented 6 years ago

Once again

popy2k14 commented 6 years ago

The default after recording task is working now, thanks a lot!

A nice addition would be that the user can select an default which will be used for the auto timer dialog in kodi.

The PVR will use the default action defined in the DMS settings dialog. That's good enough. If you want to change the action you can do this using the webinterface or another tool.

Ill must come back to this because there is no default setting in DMS for this, look here:

dms_rec_default

manuelm commented 6 years ago

There is. In the DMS settings UI. Not in it's webinterface.

manuelm commented 6 years ago

Pushed to upstream repo with 3.6.0

manuelm commented 6 years ago

Actually the setting is also exported to the webinterface. It's on the right side of your screenshot. "Task after recording" or "Aufgabe nach Aufnahme" in german:

Edit: However changing doesn't flush the file, so the PVR doesn't notice the setting unless you restart the DMS service + the PVR/Kodi.

popy2k14 commented 6 years ago

Sorry, but i cant find it:

cant_find

Just to be sure, we are talking for the defaults for the following, right?

additional_settings

manuelm commented 6 years ago

Standard-Aktion -> Aufgabe nach Aufnahme in your current screenshot(s)

popy2k14 commented 6 years ago

Sorry for beeing unclear. I'll meant the default's for:

dvbv_2

defaults

popy2k14 commented 6 years ago

Where can those be set?

manuelm commented 6 years ago

I just read your posts again. I think we have talked passed each other. You are talking about defaults for deduplication whereas I'm talking about how to change the Task after recording default value.

There are no defaults for deduplication. The first entry get's selected by Kodi.

manuelm commented 6 years ago

However I can change the default value if you want. I really don't care about this at all.

popy2k14 commented 6 years ago

yeah, now we are on the same train :-) The "Task after recording" is working correctly now. It gets the default configured in DMS and set's this.

For the deduplication: Is there a way to let user set an default addon setting which kodi uses for new auto timers?

I am using this feature to prevent duplicates based on the subtitle, see the next picture. The gray timers was deactivated because of the deduplication feature (subtitle was marked):

deactivated_timers

manuelm commented 6 years ago

Is there a way to let user set an default addon setting which kodi uses for new auto timers?

No. As I said the first value gets selected by Kodi. In general I tend to use the same defaults than the DMS. But I can change the default value to "Record if EPG title + subtitle differs" if you want. Personally, I think that's the better default value.

popy2k14 commented 6 years ago

ok, now ill got you. yes, ill think also the "Record if EPG title + subtitle differs" is the better value. Please change it to that default.

manuelm commented 6 years ago

Fixed in 3.6.1. However during testing I noticed that the default value only gets selected if you create an autotimer from the EPG guide. Creating a new autotimer from the timers dialog still selects disabled. Looks like a bug in Kodi to me.

Morpog commented 5 years ago

Any chance getting this backported to Krypton 2.4.x addon? Leia isn't released yet and i'm stuck on Krypton because of a special MVC build to have native 3D Blu-ray support (https://forum.kodi.tv/showthread.php?tid=266316).

manuelm commented 5 years ago

Looking at the forum thread there seems to be a Kodi Leia/18 version now.

I'm not sure I'll have any time to look into this in the next couple of weeks. So I don't think a backport will happen from my side.

Morpog commented 5 years ago

Hi manuelm, Yes you are right. I have contacted the maintainer of it and worked with him together on a new version of MVC support in Leia. So yes, for me it isn't needed anymore. Thanks for caring and having a look anyways. I really like the new features in pvr.dvbviewer in Leia.