This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """Convert a manual Trakt export (.zip contents) into a Yamtrack import CSV. | |
| Targets Yamtrack v0.25.3's CSV importer (integrations/imports/yamtrack.py). | |
| Key importer facts this script relies on: | |
| - Row order determines bulk-create order: movie, tv, season, episode. | |
| - TV is unique per (user, item); Season per (related_tv, item); Episode and | |
| Movie rows may repeat (that is how rewatches are stored). | |
| - Episodes are linked to seasons via (media_id, season_number) after seasons | |
| are created (update_episode_references), so season rows must precede |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a general-purpose function to ask Yes/No questions in Bash, either | |
| # with or without a default answer. It keeps repeating the question until it | |
| # gets a valid answer. | |
| ask() { | |
| # http://djm.me/ask | |
| local prompt default REPLY | |
| while true; do |