Kodi Community Forum
New MythTV add-on using libcmyth - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26)
+---- Forum: PVR (https://forum.kodi.tv/forumdisplay.php?fid=136)
+---- Thread: New MythTV add-on using libcmyth (/showthread.php?tid=110694)



RE: New MythTV add-on using libcmyth - Jimmer - 2012-04-10

(2012-04-10, 05:37)tdavis Wrote:
(2012-04-09, 22:19)tsp42 Wrote: I've added the sorting of recordings into movies / series folders based on duration/genre type and a user definable regular expression.

fiveisalive: Yes I believe so. The system boost library is placed in /usr/lib while the home-made is usually placed in /usr/local/lib.

Oh, good.. but for some reason, on my mythtv setup, it's SeriesTitle:Tonguerogram (seperated by '::').

Any ideas on what to change this to? I've been playing around, but seem to be getting no where..

Oh, never mind.. I figured it out, just added "::.*" and it started to work.

Care to share your explicit regexp? I personally tried many combinations including ::.* but couldn't get it working for me. I still get:

Homeland::Semper I
|------Homeland::Semper I

Homeland:Tongueilot
|------Homeland:Tongueilot

Homeland::Grace
|------Homeland::Grace

So, many individual top folders, each with their single episodes inside. Obviously, I'd be looking for something like:

Homeland
|------Semper I
|------Pilot
|------Grace

I wonder why the default regexp works for tsp and not for us? I wouldn't have thought there was that much variation in how mythbackend serves up the episode names....

Jim


RE: New MythTV add-on using libcmyth - dteirney - 2012-04-10

(2012-04-10, 09:23)dodoadoodoo Wrote: What version did you test with? I am running a 0.24 b/e and I seem to get the CMYTH_EVENT_UPDATE_FILE_SIZE event for all current recordings.

Weird, I was using 0.24 as well. How often do you observe the events getting fired. Perhaps I wasn't looking for them long enough. Live TV fires them out quite frequently.




RE: New MythTV add-on using libcmyth - dodoadoodoo - 2012-04-10

(2012-04-10, 10:23)dteirney Wrote:
(2012-04-10, 09:23)dodoadoodoo Wrote: What version did you test with? I am running a 0.24 b/e and I seem to get the CMYTH_EVENT_UPDATE_FILE_SIZE event for all current recordings.

Weird, I was using 0.24 as well. How often do you observe the events getting fired. Perhaps I wasn't looking for them long enough. Live TV fires them out quite frequently.

I get them every tenth second actually, looking like this (log excerpt):
10:35:07 T:2752543600 DEBUG: AddOnLog: MythTV cmyth PVR Client: EVENT ID: CMYTH_EVENT_UPDATE_FILE_SIZE, EVENT databuf: 4037 2012-04-10T10:34:00 59765576
10:35:17 T:2752543600 DEBUG: AddOnLog: MythTV cmyth PVR Client: EVENT ID: CMYTH_EVENT_UPDATE_FILE_SIZE, EVENT databuf: 4037 2012-04-10T10:34:00 73847716




RE: New MythTV add-on using libcmyth - tsp42 - 2012-04-10

The matched String between (?<title> and the next ) will be used as the folder name. If no match is found the entire title plus subtitle will be used. To match the :: used as the current separator between title and subtitle use: ^(?<title>.+?)::
The RegEx documentation is available here: http://www.boost.org/doc/libs/1_34_1/libs/regex/doc/syntax_perl.html
Mythtv can't extract the episode from the EIT data I get. I don't have any subtitles and the episode number is encode in the title like: the walking dead (18) so the current default RegEx is used to recognize this pattern. I will change the default value in the next update.


RE: New MythTV add-on using libcmyth - Jimmer - 2012-04-10

(2012-04-10, 10:45)tsp42 Wrote: The matched String between (?<title> and the next ) will be used as the folder name. If no match is found the entire title plus subtitle will be used. To match the :: used as the current separator between title and subtitle use: ^(?<title>.+?)::
The RegEx documentation is available here: http://www.boost.org/doc/libs/1_34_1/libs/regex/doc/syntax_perl.html
Mythtv can't extract the episode from the EIT data I get. I don't have any subtitles and the episode number is encode in the title like: the walking dead (18) so the current default RegEx is used to recognize this pattern. I will change the default value in the next update.

Thanks! That totally worked..... was starting to tear my hair out!

Just a little wrinkle though:

When I schedule recordings through mythweb, they are stored in mythconverg as title/subtitle, e.g:

Title / Subtitle / Description
Homeland / Semper I / "Big plans are made for national hero Brody, but his increasingly erratic behaviour threatens his status as the media's latest darling, prompting the vice president to send an adviser to check him out. Carrie nears the end of her four-week surveillance warrant and grows desperate for evidence linking the marine to Abu Nazir, but Saul instructs her to focus on the terrorist's money trail. Thriller, starring Claire Danes and Damian Lewis."

which the addon will display in the refocus skin as Homeland::Semper I with the appropriate description

However, if I schedule the same recording through the addon itself, it will be stored as:

Title / Subtitle / Description
Homeland: Semper I / Tue Apr 10 09:30:00 2012 / ""

which the addon will display as Homeland: Semper I::Tue Apr 10 09:30:00 2012 with no description information

obviously, this will create a differently titled show for each manually created recording which will not match the naming scheme used by the other mythweb scheduled recordings and they will lack episode descriptions. This has happened to me a few times where regularly scheduled recordings made via mythweb have failed for whatever reason and then I have scheduled "fill" recordings via the addon.

Some extra info: I live in the UK (using dvb-t) and primarily use the RadioTimes xmltv grabber for guide data, but also use EIT for channels that are omitted by RadioTimes. All of the above occurs whether or not the source is EIT or XMLTV. All channels provided by EIT also have correctly coloured EPG entries, whereas XMLTV one's are all the same colour irregardless of type of programming displayed.....

Thanks again for all the hard work!


RE: New MythTV add-on using libcmyth - PhoenixMage - 2012-04-10

Hi guys, just updated to the 20120409 windows build and I now only get 3 of the 15 odd chanels I usually get. Is there anything I need to delete, etc when I upgrade to resolve the issue?


RE: New MythTV add-on using libcmyth - dodoadoodoo - 2012-04-10

(2012-04-09, 23:34)dodoadoodoo Wrote:
(2012-04-09, 20:33)tsp42 Wrote: no it should only fetch the metadata. Are you sure that is downloads the actual recording? Can you check if there are any recordings stored in the coverart or fanart storage group?

Being lazy I have only configured the default storage group on the b/e. And, yes you are correct, I have both the metadata and actual recordings in those folders (two drives). Seems like someone (cmyth, myth protocol?) is a little bit greedy when fetching the metadata :-)

/D

Upon further study it seems to grab *everything* it finds in the storage group directory. I had a few stray files hanging around which also got downloaded. I am confused, but I guess I need to dive into the code.

/D


RE: New MythTV add-on using libcmyth - tdavis - 2012-04-10

(2012-04-10, 13:22)dodoadoodoo Wrote:
(2012-04-09, 23:34)dodoadoodoo Wrote:
(2012-04-09, 20:33)tsp42 Wrote: no it should only fetch the metadata. Are you sure that is downloads the actual recording? Can you check if there are any recordings stored in the coverart or fanart storage group?

Being lazy I have only configured the default storage group on the b/e. And, yes you are correct, I have both the metadata and actual recordings in those folders (two drives). Seems like someone (cmyth, myth protocol?) is a little bit greedy when fetching the metadata :-)

/D

Upon further study it seems to grab *everything* it finds in the storage group directory. I had a few stray files hanging around which also got downloaded. I am confused, but I guess I need to dive into the code.

/D

Yea, I had the same default configuration - only setup a single storage directory. It started to download everything (and I mean *everything*). I wasn't going to let it get all 600+ gb copied over, so I killed xbmc

Went back to mythtv-setup, created a new Coverart storage directory, copied all of the .png's from the main storage directory, and the download stopped.. except I'm also not getting any use of the Coverart/Screenshots in xbmc.

As for the regex, I played more with last night. The big thing I found is you have to restart xbmc to see if the changes you made work.
Is there a way other than this or clearing the db (which takes more time to reload it)?


Oh another bug I'm having problems with..

Start xbmc. Check the EPG, see there is data. Go away for 24hrs. When you come back, there is no EPG data at all.

Am I missing a setting somewhere?

thanks in advance!



RE: New MythTV add-on using libcmyth - tsp42 - 2012-04-10

Yes currently the addon downloads all contents of the coverart and fanart folders (or the default storage folder if they are not defined). I will change it.

Clicking on "recordings" in the left sideview will reload the recordings and use the new regex setting so it should not be necessary to restart xbmc to see the effect of changing the setting, Alternative I created a small test program here (compile instructions included in the source code. Save the file as rt.cpp).

Jimmer:
The way the scheduled recordings are named is a feature of the xbmc PVR code and not the addon, I don't know why dushmaniac implemented it that way but you could try creating a feature request/bug report on his github repo.

Currently the addon only knows how to translate the genres used in the EIT data (and defined in the mythtv source code here. I plan to move the translation of genres into a separate text file instead of being defined in the source code.




RE: New MythTV add-on using libcmyth - fiveisalive - 2012-04-11

Recompiled against new (local) version of boost (not easy to clue in xbmc to use boost in a non-standard directory), there should be an easier way to override the include directories other than modifying Makefile.include directly.

Anyway, it now seems to be downloading my entire mpg movies from the mythbackend into ~/.xbmc/userdata/addon_data/pvr.mythtv.cmyth/cache/coverart! What's going on? It should only need to scan a short bit of video to generate a video thumbnail.

Update: I see from the previous posts, that it downloads the contents of the default storage directory. Since many users will only have the default storage directory in MythTV, the add-on needs to handle that case more sanely. The user shouldn't have to know how their storage groups are setup and the add-on should never download multiple copies of the recordings, no matter how the groups are setup.


RE: New MythTV add-on using libcmyth - fetzerch - 2012-04-12

Great to see how this is making progress! :-)

Nice to see the recording's covers/fanart. Should the preview picture when no cover is available also work?
Mythtv stores preview pictures along with the recording but I'm not sure if the recent update pulls those in.
Weird is that I still see the default icon even though the pvr code should generate them if not available (https://github.com/opdenkamp/xbmc/pull/487).

Also the new feature that puts series into the same folder is awesome. It's working pretty good already, however
sometimes it throws me back to the main folder.
Together with the watched state that is already displayed, it's getting close to what mythtv offers here.
I created a PR in opdenkamps repo today, that allows to modify the watched flag via context menu (https://github.com/opdenkamp/xbmc/pull/508 if you want to try it).

Tsp, have you already investigated how we could sync the watched state with the backend?
Think I can get my hands dirty on it if you haven't started yet :-)
As far as I can see, it requires a change in the pvr client api, right?

Br,
Christian


RE: New MythTV add-on using libcmyth - robweber - 2012-04-13

(2012-04-12, 23:40)cfetzer Wrote: Great to see how this is making progress! :-)

Nice to see the recording's covers/fanart. Should the preview picture when no cover is available also work?
Mythtv stores preview pictures along with the recording but I'm not sure if the recent update pulls those in.
Weird is that I still see the default icon even though the pvr code should generate them if not available (https://github.com/opdenkamp/xbmc/pull/487).

Looking at the code I see that it is only syncing the coverart and fanart. I agree I'd like the mythtv generated preview picture (personally I prefer it to the coverart) since it shows a preview of the actual TV show. I think this is what the myth:// protocol in XBMC pulls in. I don't have my mythtv backend setup to pull the fanart or coverart for the episodes, which is probably why I prefer the myth generated thumbnail.

I'm seeing the "throw back" to the main folder cfetzer describes as well. I think upon the view refresh (like after sorting or playing a file) you are thrown out to the root recordings folder rather than the subfolder. Not sure if this is the fault of the addon or the xbmc pvr code.

This addon is coming along really well - thanks to tsp42 for the hard work. It is stable enough for me to use in my living room htpc.

-Edit- One question for anyone compiling from the latest source. Everything is running great but anything using the JSON api doesn't seem to be working. Is anyone else having this issue?


RE: New MythTV add-on using libcmyth - tdavis - 2012-04-13

(2012-04-10, 21:39)tsp42 Wrote: Clicking on "recordings" in the left sideview will reload the recordings and use the new regex setting so it should not be necessary to restart xbmc to see the effect of changing the setting, Alternative I created a small test program here (compile instructions included in the source code. Save the file as rt.cpp).

Got this to work under Fedora16, had to do:

cc -lboost_regex -o rt regextest.cpp -lstdc++

it compiled; tested gave:

./rt "^(?<title>.+?)::" "Show::Title"
RegEx: "^(?<title>.+?)::", test string: "Show::Title"
Title match: Show

Nice. Now, my preference would be remove the Show:: portion when in the sub folder.. but I'm patient, and will wait for any changes you make.




RE: New MythTV add-on using libcmyth - Jimmer - 2012-04-13

(2012-04-13, 03:01)robweber Wrote:
(2012-04-12, 23:40)cfetzer Wrote: Great to see how this is making progress! :-)

Nice to see the recording's covers/fanart. Should the preview picture when no cover is available also work?
Mythtv stores preview pictures along with the recording but I'm not sure if the recent update pulls those in.
Weird is that I still see the default icon even though the pvr code should generate them if not available (https://github.com/opdenkamp/xbmc/pull/487).
I'm seeing the "throw back" to the main folder cfetzer describes as well. I think upon the view refresh (like after sorting or playing a file) you are thrown out to the root recordings folder rather than the subfolder. Not sure if this is the fault of the addon or the xbmc pvr code.

This addon is coming along really well - thanks to tsp42 for the hard work. It is stable enough for me to use in my living room htpc.

-Edit- One question for anyone compiling from the latest source. Everything is running great but anything using the JSON api doesn't seem to be working. Is anyone else having this issue?

I'm also seeing the "throw-back" issue.

I don't use the json api, but if you give me a sample query to run - I'll happily test it on my rig for you....

Jim


RE: New MythTV add-on using libcmyth - dodoadoodoo - 2012-04-13

(2012-04-10, 21:39)tsp42 Wrote: Yes currently the addon downloads all contents of the coverart and fanart folders (or the default storage folder if they are not defined). I will change it.

Cool. Let me know if I can be of any assistance.

/D