knightcrawler-stremio / knightcrawler

A selfhosted Stremio addon
Apache License 2.0
228 stars 39 forks source link

movies found, but series not #140

Closed Yapping7409 closed 4 months ago

Yapping7409 commented 4 months ago

Describe the bug Movies are found, but series are not found even thought they are in the database.

To Reproduce Installed via docker locally and using npm for https.

Expected behavior I expected to also see results for series, but they are not found.

Hardware:

iPromKnight commented 4 months ago

This has been fixed in #145 I'll include a small sql script soon that you can use to re-ingest all your series data thats at fault

Thanks for reporting.

iPromKnight commented 4 months ago
BEGIN;

DROP TABLE IF EXISTS temp_info_hashes;

CREATE TEMPORARY TABLE temp_info_hashes AS
SELECT "infoHash" FROM files
WHERE ("imdbSeason" IS NULL or "imdbSeason" = 0)
  AND ("imdbEpisode" IS NULL or "imdbEpisode" = 0)
  AND ("kitsuEpisode" IS NULL or "kitsuEpisode" = 0);

DELETE FROM torrents
WHERE "infoHash" IN (SELECT "infoHash" FROM temp_info_hashes)
AND (LOWER("type") != 'movie' AND LOWER("type") != 'movies');

UPDATE ingested_torrents
SET processed = false
WHERE "category" = 'tv'
  AND info_hash IN (SELECT "infoHash" FROM temp_info_hashes);

DROP TABLE temp_info_hashes;

COMMIT;

This will remove all the broken series torrents, which the producer will then auto pickup again and re-add to the queue for processing

Yapping7409 commented 4 months ago

Thanks for all the work you did! I completely reset the containers since i didn't have a huge number of torrents yet, but i am still having some problems. Some series are found in stremio while others are not. Should all the category tv ingested torrents work when they are in the database or does imdb metadata update when available?

iPromKnight commented 3 months ago

Yw

The ingested torrents only appear in searches after they've been processed by the consumer and created in the files table. This process is what turns a magnet into an actual torrent with contents

Yapping7409 commented 3 months ago

Thanks, all the torrents in files seem to be searchable. I was also wondering how the torrent table differs from the ingested_torrents and files tables since that is used for the stats endpoint and seems to be almost half of files & ingested_torrents.