Beta Artwork support and other improvements
#16
I don't get this
https://github.com/kodi-pvr/pvr.vdr.vnsi...e.cpp#L177
cpp:

bool CVNSIClientInstance::SupportRecordingsUndelete()
{
  if (GetProtocol() > 7)
  {
    cRequestPacket vrp;
    vrp.init(VNSI_RECORDINGS_DELETED_ACCESS_SUPPORTED);

    auto vresp = ReadResult(&vrp);
    if (!vresp)
    {
      kodi::Log(ADDON_LOG_INFO, "%s - Can't get response packed", __func__);
      return false;
    }

    uint32_t ret = vresp->extract_U32();
    return ret == VNSI_RET_OK ? true : false;
  }

  kodi::Log(ADDON_LOG_INFO, "%s - Undelete not supported on backend (min. Ver. 1.3.0; Protocol 7)",
            __func__);
  return false;
}

Isn't it always return false?
Reply
#17
uint32_t ret = vresp->extract_U32();

It will return true if ret == VNSI_RET_OK
Reply
#18
But isn't that last 'return false;' overwrite previous return value?
From kodi.log I can see this message:
Code:

2022-01-29 20:39:02.778 T:1549    ERROR <general>: AddOnLog: pvr.vdr.vnsi: SupportChannelScan - Can't get response packed
2022-01-29 20:39:02.778 T:1549     INFO <general>: AddOnLog: pvr.vdr.vnsi: SupportRecordingsUndelete - Undelete not supported on backend (min. Ver. 1.3.0; Protocol 7)

Edit. I think it should be like this but I'm not expert in cpp.
cpp:

bool CVNSIClientInstance::SupportRecordingsUndelete()
{
  if (GetProtocol() > 7)
  {
    cRequestPacket vrp;
    vrp.init(VNSI_RECORDINGS_DELETED_ACCESS_SUPPORTED);

    auto vresp = ReadResult(&vrp);
    if (!vresp)
    {
      kodi::Log(ADDON_LOG_INFO, "%s - Can't get response packed", __func__);
      return false;
    }

    uint32_t ret = vresp->extract_U32();
    return ret == VNSI_RET_OK ? true : false;
  }
  else
  {
    kodi::Log(ADDON_LOG_INFO, "%s - Undelete not supported on backend (min. Ver. 1.3.0; Protocol 7)",
            __func__);
    return false;
  }
}
Reply
#19
The return statement ends the program flow.
Nothing will be done after "return ret == VNSI_RET_OK ? true : false;"

Still, this is strange.
Can you add a statement to log the result of GetProtocol() ? Seems to be <= 6.
Reply
#20
Yeah you are correct about return ending program flow. I'm now little bit wiser Big Grin

I have to check tomorrow what is output of GetProtocol()
I use GetProtocol() also in artwork support and there it works as expected.
Reply
#21
I added kodi::Log(ADDON_LOG_INFO, "Protocol Version: %i", GetProtocol()); to CVNSIClientInstance::SupportRecordingsUndelete() and result is this:

At first it gives
17:30:27.355 T:357861   ERROR <general>: AddOnLog: pvr.vdr.vnsi: SupportChannelScan - Can't get response packed
2022-03-04 17:30:27.355 T:357861    INFO <general>: AddOnLog: pvr.vdr.vnsi: Protocol Version: 0
2022-03-04 17:30:27.355 T:357861    INFO <general>: AddOnLog: pvr.vdr.vnsi: SupportRecordingsUndelete - Undelete not supported on backend (min. Ver. 1.3.0; Protocol 7)
2022-03-04 17:30:27.358 T:357894    INFO <general>: AddOnLog: pvr.vdr.vnsi: Logged in at '1646407827+7200' to 'VDR-Network-Streaming-Interface (VNSI) Server' Version: '1.8.0' with protocol version '14'

And later

2022-03-04 17:30:28.360 T:357894   ERROR <general>: AddOnLog: pvr.vdr.vnsi: SupportChannelScan - Can't get response packed
2022-03-04 17:30:28.360 T:357894    INFO <general>: AddOnLog: pvr.vdr.vnsi: Protocol Version: 14
2022-03-04 17:30:28.361 T:357861   ERROR <general>: AddOnLog: pvr.vdr.vnsi: ReadResult - request timed out after 1 seconds
2022-03-04 17:30:28.361 T:357861   ERROR <general>: AddOnLog: pvr.vdr.vnsi: GetTimerTypes - Can't get response packed
2022-03-04 17:30:28.362 T:357861    INFO <general>: PVR Manager: Starting
2022-03-04 17:30:28.492 T:357907    INFO <general>: PVR Manager: Started

So I think error is because it tries to check both SupportChannelScan and SupportRecordingsUndelete before VNSI Client is connected to backend. We need to make some sort of check for connection to GetCapabilities or somehow make VNSI client to check Capabilities after successful connection.

I can get recordings undelete and channel scan to work by deleting check from GetCapabilities. But channel scan fails for some reason (probably not supported for DVB-C?). You can access deleted recordings in Kodi from recordings and clicking left key there. 

Mar  4 17:54:47 telkka vdr: [359855] VNSI: Welcome client 'XBMC channel scanner' with protocol version '14'
Mar  4 17:54:47 telkka vdr: [359854] VNSI: cxSocket::read(fd=57): eof, connection closed
Mar  4 17:54:47 telkka vdr: [359854] VNSI-Error: Socket error: 'Failed to read header'. Dropping connection


Edit. This same issue is already discussed on Github https://github.com/kodi-pvr/pvr.vdr.vnsi/issues/162
I need to add those changes to my branches and after that it will probably work.

Edit2. didn't help. I opened issue on Github.
Reply
#22
Hi Dis,

Thank you for your great work!
Would it be possible to make this part of the official KODI repository, so it would be available to everyone, and not required to manually compile & install?
Also, could you support all data fields supported by the KODI pvr interface?
If something is missing in the vdr-plugin-tvscraper interface, I can crate a new method in this interface, and provide the missing information.

~ Markus
Reply
#23
(2022-03-05, 12:46)MarkusEh Wrote: Hi Dis,

Thank you for your great work!
Would it be possible to make this part of the official KODI repository, so it would be available to everyone, and not required to manually compile & install?
Also, could you support all data fields supported by the KODI pvr interface?
If something is missing in the vdr-plugin-tvscraper interface, I can crate a new method in this interface, and provide the missing information.

~ Markus

Do you have suggestions what data to send Kodi? Do you mean cast, genre etc? Currently only fanart and poster is send to Kodi.

Before this can be made part of official Kodi repository we need vnsiserver what supports this. I have made PR to vnsiserver https://github.com/mdre77/vdr-plugin-vnsiserver/pull/4 but that is not merged and I don't want maintain vnsiserver myself. And there's probably room for improvements in my code. Can you take look if you find something odd?

Edit. Recordings doesn't support many tags (https://xbmc.github.io/docs.kodi.tv/mast...dings.html) comparing to EPG (https://xbmc.github.io/docs.kodi.tv/mast...g_tag.html)
So I don't know if there's any reason to add extra data from TVScraper. Maybe for EPG?

Edit2. Correct me if I'm wrong, tvscraper doesn't output writer and director of movie or tvshow? Only actors?
Reply
#24
I thought about season number and episode number.

> tvscraper doesn't output writer and director of movie or tvshow? Only actors?
This is (currently) correct. As mentioned, I can add more fields in vdr-plugin-tvscraper.
And I will do that if you pass this information to KODI with vnsi.

Just tell me which fields you need.
Reply
#25
Can you add support for writer and director to tvscraper? I don't think there's anything else I need.
Maybe I start with season and episode numbers because those are both available for EPG and recordings.
Reply
#26
I also thought about providing internet URLs to poster/fanart images, instead of or in addition to the path to local files.
Would this help?
Reply
#27
(2022-03-07, 09:58)MarkusEh Wrote: I also thought about providing internet URLs to poster/fanart images, instead of or in addition to the path to local files.
Would this help?

Yes that would be really helpful so user doesn't need to deal with file paths if VDR and Kodi is in different PC. Instead we could use internet URLs.
Need to consider whether to use local files if VDR and Kodi is in same PC but internet URLs for other. Or always use internet URLs?
Reply
#28
I updated vnsiserver and client for additional infos (actors, rating, season, episode, episode thumbs, original title, first aired). I have also renamed previous settings so you need to re-enable artwork.
Reply
#29
Hi,

In the latest git https://github.com/MarkusEh/vdr-plugin-tvscraper , tvscraper has a new interface.
This interface supports more attributes, and urls for some images.
See class cScraperMovieOrTv in https://github.com/MarkusEh/vdr-plugin-t...services.h for details.
Name in vdr service interface: "GetScraperMovieOrTv".

This interface is still in beta mode, so there might be changes. Your feedback is very welcome, if you would like me to change the interface, just answer in this thread.

Have fun, Markus

P.S.: One thing I'm thinking about is performance. I'm still not sure if performance is an issue. If not, I might remove the //IN parameters "bool httpImagePaths;" and "bool media;"
Reply
#30
@MarkusEh  Thanks for new interface. I can't get GetScraperMovieOrTv to work. Below is what I tried. VDR just crashes.

Code:

      // images
      std:Confusedtring PosterPath = "";
      std:Confusedtring FanartPath = "";
      std:Confusedtring EpisodeImagePath = "";

      // extra info
      int Season = 0;
      int Episode = 0;
      std:Confusedtring FirstAired = "";

      // first try scraper2vdr
      static cPlugin *pScraper = cPluginManager::GetPlugin("scraper2vdr");
      if (!pScraper) // if it doesn't exit, try tvscraper
        pScraper = cPluginManager::GetPlugin("tvscraper");
      if (pScraper)
      {
        bool httpImagePaths = true;
        bool media = false;
        cScraperMovieOrTv call;
        call.recording = recording;
        call.httpImagePaths = httpImagePaths;
        call.media = media;

        if (pScraper->Service("GetScraperMovieOrTv", &call))
        {
          if (call.found)
          {
            PosterPath = call.posterUrl;
            FanartPath = call.fanartUrl;
          }
        }
       }
Reply

Logout Mark Read Team Forum Stats Members Help
Artwork support and other improvements0