MythTV-Clients / MythTV-Android-Frontend

Implementation of MythTV .25+ Services API for Android
GNU General Public License v3.0
66 stars 16 forks source link

Episodes recorded with old hostnames are missing #244

Closed fransg closed 10 years ago

fransg commented 10 years ago

Hi, I like this app, looks very promising! I am trying to set this up on an Android TV-stick (RK3188-based Ugoos QC802). As a long time MythTV-user (from 2005) I found that episodes recorded prior to last June are not shown in the list. The main category is there, i.e. in the alphabetic list of recordings. If I select a recording name, I only get to see the episodes if that recording was made recently. If all episodes predate this, then I just see an empty screen. It seems to coincide with the moment I replaced my server. At that time, I got a new hostname and I upgraded from MythTV 0.25 to 0.26. It seems likely one of these is the cause for the missing episodes: recordings done on my current server do show, while older ones do not. Could you please look into that? I realize that quite likely I can fix it in the mythconverg-database myself by running some update-script, but as I suppose that more users will have similar issues it makes sense to fix it in the code.

I would be happy to assist in diagnosing and testing.

My mythbackend info is: Please attach all output as a file in bug reports. MythTV Version : v0.26.1 MythTV Branch : Network Protocol : 75 Library API : 0.26.20130225-1 QT Version : 4.8.4 Options compiled in: linux release use_hidesyms using_alsa using_jack using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_dvb using_firewire using_frontend using_hdhomerun using_ceton using_hdpvr using_iptv using_ivtv using_joystick_menu using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_libudf using_lirc using_mheg using_opengl_video using_qtwebkit using_qtscript using_qtdbus using_v4l2 using_x11 using_xrandr using_xv using_bindings_perl using_bindings_python using_bindings_php using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_live using_mheg using_libass using_libxml2 using_libudf Running on openSUSE 12.3 x86_64. And just to be complete: my previous server ran Fedora 17 x86_64.

Thanks and good luck, Frans

dmfrey commented 10 years ago

Frans,

Can you dump the xml generated by the backend:

curl -X GET http://:6544/Dvr/GetRecordedList -o GetRecordedList.xml

and post it here. I am guessing the hostname in those entries is still using the old name. If so, it should be easy to go into the database and update those records so they have the correct host name.

You can also just plug http://:6544/Dvr/GetRecordedList into your browser and review the results in a nice, formatted way.

fransg commented 10 years ago

Hi Daniel, thanks for you quick reply. I typed the URL in my browser and got a huge XML-representation of my recordings (over 2.000 recordings, the oldest dating back to 2006). If it helps I can upload it somewhere, but I think we are close to a solution already. In the list I can see three 'generations' of hostnames, corresponding to three subsequent servers. I tried changing the hostname attribute in the 'recorded'-table in the 'mythconverg'-database. That didn't help. I remember having seen that before; apparently the hostname is taken from another table. Do you know by heart which one it is? If so, please let me know. In the meantime I will continue and try to locate the right table/attribute. BTW: The mythfrontend is not bothered by having different hostnames and neither is XBMC/PVR-addon. Shouldn't the MythTV-Android-Frontend-app also ignore the hostname? Or is there a relevance to it that I do not know about?

Thanks! Frans

Daniel Frey schreef op 11-11-2013 14:54:

Frans,

Can you dump the xml generated by the backend:

curl -X GET http://:6544/Dvr/GetRecordedList -o GetRecordedList.xml

and post it here. I am guessing the hostname in those entries is still using the old name. If so, it should be easy to go into the database and update those records so they have the correct host name.

You can also just plug http://:6544/Dvr/GetRecordedList into your browser and review the results in a nice, formatted way.

On Mon, Nov 11, 2013 at 3:58 AM, fransg notifications@github.com wrote:

Hi, I like this app, looks very promising! I am trying to set this up on an Android TV-stick (RK3188-based Ugoos QC802). As a long time MythTV-user (from 2005) I found that episodes recorded prior to last June are not shown in the list. The main category is there, i.e. in the alphabetic list of recordings. If I select a recording name, I only get to see the episodes if that recording was made recently. If all episodes predate this, then I just see an empty screen. It seems to coincide with the moment I replaced my server. At that time, I got a new hostname and I upgraded from MythTV 0.25 to 0.26. It seems likely one of these is the cause for the missing episodes: recordings done on my current server do show, while older ones do not. Could you please look into that? I realize that quite likely I can fix it in the mythconverg-database myself by running some update-script, but as I suppose that more users will have similar issues it makes sense to fix it in the code.

I would be happy to assist in diagnosing and testing.

My mythbackend info is: Please attach all output as a file in bug reports. MythTV Version : v0.26.1 MythTV Branch : Network Protocol : 75 Library API : 0.26.20130225-1 QT Version : 4.8.4 Options compiled in: linux release use_hidesyms using_alsa using_jack using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_dvb using_firewire using_frontend using_hdhomerun using_ceton using_hdpvr using_iptv using_ivtv using_joystick_menu using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_libudf using_lirc using_mheg using_opengl_video using_qtwebkit using_qtscript using_qtdbus using_v4l2 using_x11 using_xrandr using_xv using_bindings_perl using_bindings_python using_bindings_php using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_live using_mheg using_libass using_libxml2 using_libudf Running on openSUSE 12.3 x86_64. And just to be complete: my previous server ran Fedora 17 x86_64.

Thanks and good luck, Frans

— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/244 .

My Google Profile http://www.google.com/profiles/dmfrey

— Reply to this email directly or view it on GitHub https://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/244#issuecomment-28201164.

dmfrey commented 10 years ago

Frans,

Unfortunately the hostname is required. We have users who have multiple backends (i.e their main one they use every day as well as testing ones running latest builds, etc.). So we need to delimit the data from one backend against another. Also, this lets us tie together relevant data when you setup both home and away profiles pointing to the same physical backend. This allows us to limit what we do so we are not always redownloading and processing the same data over and over.

I believe if you fix your hostname entries in all the right places, you should resolve your issue. @billmeek, do you know where else Frans would need to change his hostname entries?

Dan

On Mon, Nov 11, 2013 at 11:18 AM, fransg notifications@github.com wrote:

Hi Daniel, thanks for you quick reply. I typed the URL in my browser and got a huge XML-representation of my recordings (over 2.000 recordings, the oldest dating back to 2006). If it helps I can upload it somewhere, but I think we are close to a solution already. In the list I can see three 'generations' of hostnames, corresponding to three subsequent servers. I tried changing the hostname attribute in the 'recorded'-table in the 'mythconverg'-database. That didn't help. I remember having seen that before; apparently the hostname is taken from another table. Do you know by heart which one it is? If so, please let me know. In the meantime I will continue and try to locate the right table/attribute. BTW: The mythfrontend is not bothered by having different hostnames and neither is XBMC/PVR-addon. Shouldn't the MythTV-Android-Frontend-app also ignore the hostname? Or is there a relevance to it that I do not know about?

Thanks! Frans

Daniel Frey schreef op 11-11-2013 14:54:

Frans,

Can you dump the xml generated by the backend:

curl -X GET http://:6544/Dvr/GetRecordedList -o GetRecordedList.xml

and post it here. I am guessing the hostname in those entries is still using the old name. If so, it should be easy to go into the database and update those records so they have the correct host name.

You can also just plug http://:6544/Dvr/GetRecordedList into your browser and review the results in a nice, formatted way.

On Mon, Nov 11, 2013 at 3:58 AM, fransg notifications@github.com wrote:

Hi, I like this app, looks very promising! I am trying to set this up on an Android TV-stick (RK3188-based Ugoos QC802). As a long time MythTV-user (from 2005) I found that episodes recorded prior to last June are not shown in the list. The main category is there, i.e. in the alphabetic list of recordings. If I select a recording name, I only get to see the episodes if that recording was made recently. If all episodes predate this, then I just see an empty screen. It seems to coincide with the moment I replaced my server. At that time, I got a new hostname and I upgraded from MythTV 0.25 to 0.26. It seems likely one of these is the cause for the missing episodes: recordings done on my current server do show, while older ones do not. Could you please look into that? I realize that quite likely I can fix it in the mythconverg-database myself by running some update-script, but as I suppose that more users will have similar issues it makes sense to fix it in the code.

I would be happy to assist in diagnosing and testing.

My mythbackend info is: Please attach all output as a file in bug reports. MythTV Version : v0.26.1 MythTV Branch : Network Protocol : 75 Library API : 0.26.20130225-1 QT Version : 4.8.4 Options compiled in: linux release use_hidesyms using_alsa using_jack using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_dvb using_firewire using_frontend using_hdhomerun using_ceton using_hdpvr using_iptv using_ivtv using_joystick_menu using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_libudf using_lirc using_mheg using_opengl_video using_qtwebkit using_qtscript using_qtdbus using_v4l2 using_x11 using_xrandr using_xv using_bindings_perl using_bindings_python using_bindings_php using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_live using_mheg using_libass using_libxml2 using_libudf Running on openSUSE 12.3 x86_64. And just to be complete: my previous server ran Fedora 17 x86_64.

Thanks and good luck, Frans

— Reply to this email directly or view it on GitHub< https://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/244> .

My Google Profile http://www.google.com/profiles/dmfrey

— Reply to this email directly or view it on GitHub < https://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/244#issuecomment-28201164 .

— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/244#issuecomment-28213449 .

My Google Profile http://www.google.com/profiles/dmfrey

billmeek commented 10 years ago

Frans. If you can identify a single title that isn't working, the following will result in a much shorter list that you could put in your favorite pastebin:

<youMasterBackend>:6544/Dvr/GetRecordedList?TitleRegEx=<failingRecordingTitle>&Count=1

Dan. I'm looking at the MythTV source, GetRrecordedList calls LoadFromRecorded, which (in part) includes this:

    "FROM recorded AS r "
    "LEFT JOIN channel AS c "
    "ON (r.chanid    = c.chanid) "
    "LEFT JOIN recordedprogram AS p "
    "ON (r.chanid    = p.chanid AND "
    "    r.progstart = p.starttime) "
    "LEFT JOIN record AS rec "
    "ON (r.recordid = rec.recordid) "

I don't see hostname in either of channel or recordedprogram. My guess would have been changing recorded too.

Makes me wonder about our old friend corrupt timestamps. We need to look at the pastebin.

Frans, please also mention the version of MythTV Android Frontend you're running. Probably 1.10.1 (or 1.20.6 if you're a beta tester.)

billmeek commented 10 years ago

@dmfrey, and to answer your other question, hostname should match the output of hostname on the command line, unless config.xml has been changed (the LocalHostName entry.) I missed he record table in my last response, but it doesn't have a hostname field either.

In the source above, if the hostname is missing, it get's one on the fly. I don't believe it's derived from another table.

        QString hostname = query.value(15).toString();
        if (hostname.isEmpty())
            hostname = gCoreContext->GetHostName();
fransg commented 10 years ago

Thanks Bill, the solution was simpler than we (or at least I) thought. The recorded-table is the location it takes the hostname from after all. It only required a restart of mythbackend and mysql before it was picked up by the GetRecordedList. I'm not sure if this was an incident (or I messed up..), or whether it always requires a restart before the change becomes visible. Maybe the response to the request got cached somewhere? I will do some more testing and follow up.

@Daniel: your explanation about having multiple hostnames makes sense, I will just go ahead and update my database (after completion of further tests, that is).

Thanks!

Frans

billmeek schreef op 11-11-2013 18:11:

@dmfrey https://github.com/dmfrey, and to answer your other question, |hostname| should match the output of |hostname| on the command line, unless |config.xml| has been changed (the |LocalHostName| entry.) I missed he |record| table in my last response, but it doesn't have a |hostname| field either.

In the source above, if the hostname is missing, it get's one on the fly. I don't believe it's derived from another table.

     QString  hostname  =  query.value(15).toString();
     if  (hostname.isEmpty())
         hostname  =  gCoreContext->GetHostName();

— Reply to this email directly or view it on GitHub https://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/244#issuecomment-28219256.

fransg commented 10 years ago

Here's my feedback after a bit more testing. I am now certain that setting the 'hostname' attribute of the 'recorded' table to the right hostname is all that is needed to get all recordings/episodes listed. What made it confusing is that (probably due to caching) the effect of updating the database was not immediately apparent. That is hardly a problem, however, as updates to the recorded-table are rare. I have updated hostname and now all is OK. So this problem has been solved as far as I'm concerned. Thanks for your help!

dmfrey commented 10 years ago

closes #244

Frans, I am glad we were able to help and that the issue is resolved. Please let us know if you run into any other issues.

On Mon, Nov 11, 2013 at 4:27 PM, fransg notifications@github.com wrote:

Here's my feedback after a bit more testing. I am now certain that setting the 'hostname' attribute of the 'recorded' table to the right hostname is all that is needed to get all recordings/episodes listed. What made it confusing is that (probably due to caching) the effect of updating the database was not immediately apparent. That is hardly a problem, however, as updates to the recorded-table are rare. I have updated hostname and now all is OK. So this problem has been solved as far as I'm concerned. Thanks for your help!

— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/244#issuecomment-28240722 .

My Google Profile http://www.google.com/profiles/dmfrey

fransg commented 10 years ago

Great, thanks! It is quite possible that I encounter more issues. I am currently trying to use an Android-stick as a replacement for my Intel-based mini-itx settop-box, running OpenElec (XBMC) including MythTV pvr-addon. The QC802 that I use now has very poor WiFi-reception though, so that is not going to work. Also, the stick is connected to my TV, hence I do not have a touch-screen to control it. I am using an Rii I8 mini keyboard with (single-touch) touchpad instead. On my phone, a Samsung Galaxy Nexus running Android 4.2, the app works like a charm though, so I am optimistic.. :-) Keep up the good work!!

Daniel Frey schreef op 11-11-2013 22:41:

closes #244

Frans, I am glad we were able to help and that the issue is resolved. Please let us know if you run into any other issues.

On Mon, Nov 11, 2013 at 4:27 PM, fransg notifications@github.com wrote:

Here's my feedback after a bit more testing. I am now certain that setting the 'hostname' attribute of the 'recorded' table to the right hostname is all that is needed to get all recordings/episodes listed. What made it confusing is that (probably due to caching) the effect of updating the database was not immediately apparent. That is hardly a problem, however, as updates to the recorded-table are rare. I have updated hostname and now all is OK. So this problem has been solved as far as I'm concerned. Thanks for your help!

— Reply to this email directly or view it on GitHubhttps://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/244#issuecomment-28240722 .

My Google Profile http://www.google.com/profiles/dmfrey

— Reply to this email directly or view it on GitHub https://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/244#issuecomment-28242221.

billmeek commented 10 years ago

For the archive, changed the title to reflect the root cause, and closed the issue.

UlfGran commented 10 years ago

I have a strong feeling that I am suffering from the same problem that is described above. My MythTV database also has a history of beeing moved between different hostnames, and when I try to use the MythTV Android frontend app, I am only able to play the recordings that was done on my current MythTv backend machine. However, when I did the move of the database from the previous machine to the current one, I followed the instructions here: http://www.mythtv.org/wiki/Database_Backup_and_Restore#Change_the_hostname_of_a_MythTV_frontend_or_backend Hence, I was under the impression that the hostnames in the database should have been set correctly by the backup restore script, as is described under the link above.

Since I have very limited knowledge of SQL syntax, and no knowledge at all of the MythTV database structure, I need help in order to be able to check if the hostnames are actually wrong in the database, and if so, to be able to correct them in such a way that the Android Frontend app will work. Is it possible that one of you that took part in solving this problem could please give me the full SQL commands needed to check the database for incorrect hostnames, and to set them correctly.I do know how to log in to the MySql database, but that is just about all. This help would be greatly appreciated. Also, I think posting this information here could be helpful to others suffering the same problem. / Regards Ulf G.

fransg commented 10 years ago

Hi Ulf,

So you see some recordings in the app, but not the older ones? That sounds very similar indeed. Fortunately, fixing it is simple.

Here is a set of commands that should get you started. Before that though it is probably a good idea to create a database-backup of your mythconverg-database.

Good luck and let me know if that worked.

Best regards, Frans

UlfGran schreef op 31-12-2013 15:37:

I have a strong feeling that I am suffering from the same problem that is described above. My MythTV database also has a history of beeing moved between different hostnames, and when I try to use the MythTV Android frontend app, I am only able to play the recordings that was done on my current MythTv backend machine. However, when I did the move of the database from the previous machine to the current one, I followed the instructions here: http://www.mythtv.org/wiki/Database_Backup_and_Restore#Change_the_hostname_of_a_MythTV_frontend_or_backend Hence, I was under the impression that the hostnames in the database should have been set correctly by the backup restore script, as is described under the link above.

Since I have very limited knowledge of SQL syntax, and no knowledge at all of the MythTV database structure, I need help in order to be able to check if the hostnames are actually wrong in the database, and if so, to be able to correct them in such a way that the Android Frontend app will work. Is it possible that one of you that took part in solving this problem could please give me the full SQL commands needed to check the database for incorrect hostnames, and to set them correctly.I do know how to log in to the MySql database, but that is just about all. This help would be greatly appreciated. Also, I think posting this information here could be helpful to others suffering the same problem. / Regards Ulf G.

— Reply to this email directly or view it on GitHub https://github.com/MythTV-Clients/MythTV-Android-Frontend/issues/244#issuecomment-31396666.

UlfGran commented 10 years ago

Hi Frans, Thank you for your quick and kind reply.

Yes, clearly this was the exactly the same issue. The symptoms you describe at the top were exactly the same. And the first SQL query you give above showed that there were two different hostnames in the recording data, one for new recordings, and one for older. When my database was updated to contain only the new hostname, all recording data became available in the frontend app. However, it seems the app has a locally cached list of the recording data. There is a reload button in the app, and it was not until I had pressed this reload button that the complete recording data became visible in the app. Perhaps this explains the issue with caching of data that you mention above?

The problem with old the hostname in the database should actually have been solved already when I restored the database backup with the restore script using the --change_hostname option. But when I saw the hostnames displayed from your first SQL query, I realized that I made a mistake regarding what the old hostname was, so this explains why the restore script did not remove the old hostname.

Anyway, my problem is now solved. Thanks again for your help. /Ulf

fransg commented 10 years ago

No problem Ulf, glad that it's solved!