cjmanca / plex-credits-detect

Augments plex's built in intro detection, additionally detecting credits.
MIT License
113 stars 5 forks source link

Installed on Docker/Synology and container keeps restarting #27

Closed YanisKyr closed 2 years ago

YanisKyr commented 2 years ago

Hiya, I'm trying to figure out what is wrong but I don't think I see the culprit in the logs. Could you please give me a hand troubleshooting this?

Here's my docker-compose:

version: "3.3"
services:
    plex-credits-detect:
        container_name: plex-credits-detect
        image: cjmanca/plex-credits-detect:main
        network_mode: bridge
        restart: unless-stopped
        environment:
            - TZ=Europe/London
            - PUID=xx
            - PGID=xx
        volumes:
            - /volume1/docker/plex-credits-detect:/config
            - /volume1/docker/plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases:/PlexDB
            - /volume1/media:/media

Here are the logs:

today at 01:02:25   Container started
today at 01:02:19   at plexCreditsDetect.Database.SQLResultInfo.GetInt(String v) in /src/plex-credits-detect/Database/SQLResultInfo.cs:line 37
today at 01:02:19   at plexCreditsDetect.Database.SQLResultInfo.Get[T](String v) in /src/plex-credits-detect/Database/SQLResultInfo.cs:line 109
today at 01:02:19   at plexCreditsDetect.Database.PlexDB.GetRootDirectories() in /src/plex-credits-detect/Database/PlexDB.cs:line 630
today at 01:02:19   at plexCreditsDetect.Database.PlexDB.get_RootDirectories() in /src/plex-credits-detect/Database/PlexDB.cs:line 35
today at 01:02:19   at plexCreditsDetect.Program.Main(String[] args) in /src/plex-credits-detect/Program.cs:line 31
today at 01:02:25   Loading global config file: /config/plex-credits-detect/fingerprint.ini
today at 01:02:25   Unhandled exception. System.InvalidCastException: Specified cast is not valid.
today at 01:02:25   at System.Data.SQLite.SQLiteDataReader.VerifyType(Int32 i, DbType typ)
today at 01:02:31   Container started
today at 01:02:25   at System.Data.SQLite.SQLiteDataReader.GetInt32(Int32 i)
today at 01:02:25   at plexCreditsDetect.Database.SQLResultInfo.GetInt(String v) in /src/plex-credits-detect/Database/SQLResultInfo.cs:line 37
today at 01:02:25   at plexCreditsDetect.Database.SQLResultInfo.Get[T](String v) in /src/plex-credits-detect/Database/SQLResultInfo.cs:line 109
today at 01:02:25   at plexCreditsDetect.Database.PlexDB.GetRootDirectories() in /src/plex-credits-detect/Database/PlexDB.cs:line 630
today at 01:02:25   at plexCreditsDetect.Database.PlexDB.get_RootDirectories() in /src/plex-credits-detect/Database/PlexDB.cs:line 35
today at 01:02:25   at plexCreditsDetect.Program.Main(String[] args) in /src/plex-credits-detect/Program.cs:line 31
today at 01:02:31   Loading global config file: /config/plex-credits-detect/fingerprint.ini
today at 01:02:32   Unhandled exception. System.InvalidCastException: Specified cast is not valid.
today at 01:02:32   at System.Data.SQLite.SQLiteDataReader.VerifyType(Int32 i, DbType typ)
today at 01:02:32   at System.Data.SQLite.SQLiteDataReader.GetInt32(Int32 i)
today at 01:02:37   Container started
today at 01:02:32   at plexCreditsDetect.Database.SQLResultInfo.GetInt(String v) in /src/plex-credits-detect/Database/SQLResultInfo.cs:line 37
today at 01:02:32   at plexCreditsDetect.Database.SQLResultInfo.Get[T](String v) in /src/plex-credits-detect/Database/SQLResultInfo.cs:line 109
today at 01:02:32   at plexCreditsDetect.Database.PlexDB.GetRootDirectories() in /src/plex-credits-detect/Database/PlexDB.cs:line 630
today at 01:02:32   at plexCreditsDetect.Database.PlexDB.get_RootDirectories() in /src/plex-credits-detect/Database/PlexDB.cs:line 35
today at 01:02:32   at plexCreditsDetect.Program.Main(String[] args) in /src/plex-credits-detect/Program.cs:line 31
today at 01:02:37   Loading global config file: /config/plex-credits-detect/fingerprint.ini
today at 01:02:38   Unhandled exception. System.InvalidCastException: Specified cast is not valid.
today at 01:02:38   at System.Data.SQLite.SQLiteDataReader.VerifyType(Int32 i, DbType typ)
today at 01:02:38   at System.Data.SQLite.SQLiteDataReader.GetInt32(Int32 i)
today at 01:02:38   at plexCreditsDetect.Database.PlexDB.get_RootDirectories() in /src/plex-credits-detect/Database/PlexDB.cs:line 35
today at 01:02:38   at plexCreditsDetect.Program.Main(String[] args) in /src/plex-credits-detect/Program.cs:line 31

And here is my fingerprint.ini

[directories]
/media = C:\path\this\tool\sees\to\library

[intro]
introStart = 0
introEnd = 0.5
introMaxSearchPeriod = 900

[credits]
creditsStart = 0.75
creditsEnd = 1.0
creditsMaxSearchPeriod = 600

[matching]
useAudio = true
useVideo = false
introMatchCount = 0
creditsMatchCount = 1
quickDetectFingerprintSamples = 5
fullDetectFingerprintMaxSamples = 10
audioAccuracy = 4
stride = 512
sampleRate = 5512
minFrequency = 100
maxFrequency = 2750
videoAccuracy = 2
videoSizeDivisor = 50
frameRate = 1

[silence]
detectSilenceAfterCredits = true
silenceDecibels = -55

[blackframes]
detectBlackframes = true
blackframeOnlyMovies = true
blackframeUseMaxSearchPeriodForEpisodes = true
blackframeUseMaxSearchPeriodForMovies = false
blackframeScreenPercentage = 75
blackframePixelPercentage = 2
blackframeMovieMinimumMatchSeconds = 20

[timing]
shiftSegmentBySeconds = 2
minimumMatchSeconds = 20
PermittedGap = 3
PermittedGapWithMinimumEnclosure = 10

[redetection]
crawlDirectoriesOnStartup = false
recheckBlackframesOnStartup = false
recheckSilenceOnStartup = false
recheckUndetectedOnStartup = false
forceRedetect = false
redetectIfFileSizeChanges = true

[monitoring]
monitorPlexIntros = true
monitorDirectoryChanges = true

[paths]
databasePath = /config/plex-credits-detect/database
PlexDatabasePath = /PlexDB/com.plexapp.plugins.library.db
TempDirectoryPath = /config/plex-credits-detect/temp
ffmpegPath = ffmpeg
cjmanca commented 2 years ago

There's one issue in your ini at least anyway:

[directories]
/media = C:\path\this\tool\sees\to\library

The left side of the = sign is supposed to be the path that the plex-credits-scanner tool sees to the actual library listed in Plex - so unless you only have one library set to that media directory, then you probably need a few more entries for each library.

The right side of the = sign is the path that Plex Media Server sees to the same equivalent library (which again may be different than your global paths if it's also inside a container).

If you have both PCS and PMS set with the same path structure (so they see the same paths for everything), then you could just omit any paths at all, and it'll grab them from the plex database.

As an example for me: image image

With two libraries set up like that, I'd enter:

[directories]
/media/TV Shows = J:\movies\TV Shows
/media/Anime = J:\movies\Anime

The errors in the console imply that it's having trouble connecting to the plex database, or the database has an unexpected format. Please verify that the plex DB is actually at the path: /volume1/docker/plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db And make sure that the PCD docker container would have read/write permissions to it.

If the errrors continue after you've verified the path and permissions, you could try doing an "Optimize Database" in Plex, and after that's done, shut down the plex server and PCD and do a database repair as described here: https://support.plex.tv/articles/repair-a-corrupted-database/

YanisKyr commented 2 years ago

Woohoo, it was the paths. Both containers see them the same so I removed the entry from fingerprint and it started running :)

Thanks a lot for your help.

image