Change SQL command to import all movies and tv categories and skip duplicates

This commit is contained in:
NebKi
2024-02-06 11:09:17 +01:00
committed by GitHub
parent 0a71104124
commit 741ef4c5a9

View File

@@ -190,9 +190,9 @@ This can be done by running the following command:
```
docker exec -it knightcrawler-postgres-1 psql -d knightcrawler -c "
INSERT INTO ingested_torrents (name, source, category, info_hash, size, seeders, leechers, imdb, processed, \"createdAt\", \"updatedAt\")
INSERT INTO ingested_torrents (name, source, category, info_hash, size, seeders, leechers, imdb, processed, "createdAt", "updatedAt")
SELECT title, 'RARBG', cat, hash, size, NULL, NULL, imdb, false, current_timestamp, current_timestamp
FROM items where cat='tv' OR cat='movies';"
FROM items WHERE NOT EXISTS (SELECT info_hash FROM ingested_torrents WHERE ingested_torrents.info_hash = items.hash) AND (cat LIKE 'tv%' OR cat LIKE 'movies%');"
```
You should get a response similar to: