croneter / PlexKodiConnect

Plex integration in Kodi done right
GNU General Public License v2.0
1.16k stars 77 forks source link

Kodi Omega Beta 3 and beyond: fix movies not showing up (thanks @Spacetech) #2028

Closed croneter closed 7 months ago

croneter commented 7 months ago

Original PR by @Spacetech: https://github.com/croneter/PlexKodiConnect/pull/2026 Fixes https://github.com/croneter/PlexKodiConnect/issues/2025

Adam1986 commented 7 months ago

Evening guys, so my PKC updated to 3.8.6 just a short while ago.

I restarted my CoreELEC install & was greeted with a prompt about this version of KODI needing a database reset. So followed it through, unfortunately I now have an empty Movies collection!

Has something accidently been regressed by mistake? As when I edited the two files that Spacetech had edited earlier in the week all worked fine for me.

Have reset the database via PKC settings too, but just the same.

thorindwarf commented 7 months ago

No issues at all here after upgrading from 3.8.4 to 3.8.6, followed the pkc prompts for Kodi db reset. No modifications to any file upfront. LibreELEC 11.0.3 (Kodi 20.2) on Pi4

Adam1986 commented 7 months ago

No issues at all here after upgrading from 3.8.4 to 3.8.6, followed the pkc prompts for Kodi db reset. No modifications to any file upfront. LibreELEC 11.0.3 (Kodi 20.2) on Pi4

Ah so in your case you still look to be on KODI 20 & not at least 21 Beta 3.

I downgraded back to 3.8.5 & rebuilt the database again and appears to be working OK on that version.

Spacetech commented 7 months ago

@croneter This change is causing trouble on the latest nexus release.

The result of

        self.cursor.execute('PRAGMA table_info(videoversion)')
        columns = self.cursor.fetchall()

is: [(0, 'idFile', 'INTEGER', 0, None, 1), (1, 'idMedia', 'INTEGER', 0, None, 0), (2, 'media_type', 'TEXT', 0, None, 0), (3, 'itemType', 'INTEGER', 0, None, 0), (4, 'idType', 'INTEGER', 0, None, 0)]

I think the code needs to be something like:

        # Check whether all needed columns for table videoversion actually exist
        self.cursor.execute('PRAGMA table_info(videoversion)')
        columns = self.cursor.fetchall()
        needed_columns = (
            'idFile',
            'idMedia',
            'media_type',
            'itemType',
            'idType'
        )

        for column_info in columns:
            if column_info[1] not in needed_columns:
                return

        self._has_video_version_table = True
croneter commented 7 months ago

That's what happens if you can't run Kodi Nexus 3 and try to fix stuff for it :disappointed:. Will hopefully work now

Adam1986 commented 7 months ago

Can confirm all working OK now, thanks for resolving the issue so quickly both.