Migrate Kitsu to use library_id and remote_id properly (#2609)

This commit is contained in:
Constantin Piber
2025-10-31 18:52:44 +01:00
committed by GitHub
parent 0b6de39f2f
commit cbf72f4c60
5 changed files with 18 additions and 6 deletions

View File

@@ -0,0 +1,7 @@
-- Save the current remote_id as library_id, since old Kitsu tracker did not use this correctly
UPDATE manga_sync SET library_id = remote_id WHERE sync_id = 3;
-- Kitsu and Suwayomi aren't using the remote_id field properly, but for both the ID is present in the URL
-- This parses a url and gets the ID from the trailing path part, e.g. https://kitsu.app/manga/<id>
-- Based on https://stackoverflow.com/a/38330814
UPDATE manga_sync SET remote_id = replace(remote_url, rtrim(remote_url, replace(remote_url, '/', '')), '') WHERE sync_id IN (3, 9);