At the core, this links the two APIs together: This first queries the Jellyfin API for YouTube videos for any videos that don't have metadata to then populate the required fields from Tube Archivist. Then as a secondary step this will transfer the artwork.
An example configuration is provided in the docker-compose.yml file. Configure these environment variables:
-`TA_URL`: Full URL where Tube Archivist is reachable
-`TA_TOKEN`: Tube Archivist API token, accessible from the settings page
-`JF_URL`: Full URL where Jellyfin is reachable
-`JF_TOKEN`: Jellyfin API token
-`LISTEN_PORT`: Optionally change the port where the integration is listening for messages. Defaults to `8001`. If you change this, make sure to also change the json link for auto trigger as described below.
Mount the `/youtube` folder from Tube Archivist also in this container at `/youtube` to give this integration access to the media archive.
### Manual trigger
For an initial import or for other irregular occasions, trigger the library scan from outside the container, e.g.:
```bash
docker exec -it tubearchivist-jf python main.py
```
### Auto trigger
Use the notification functionality of Tube Archivist to automatically trigger a library scan whenever the download task complets in Tube Archivist. For the `Start download` schedule on your settings page add a json Apprise link to send a push notification to the `tubearchivist-jf` container on task completion, make sure to specify the port, e.g.:
Due to the filesystem change between Tube Archivist v0.3.6 to v0.4.0, this will reset your YouTube videos in Jellyfin and will add them as new again. Unfortunatly there is no migration path.
To import an existing Tube Archivist archive created with v0.3.4 or before, there are a few manual steps needed. These issues are fixed with videos and channels indexed with v0.3.5 and later.
Apply these fixes *before* importing the archive.
**Permissions**
Fix folder permissions not owned by the correct user. Navigate to the `ta_video_path` and run:
```bash
sudo chown -R $UID:$GID .
```
**Channel Art**
Tube Archivist v0.3.5 adds additional art work to the channel metadata. To trigger an automatic refresh of your old channels open a Python shell within the *tubearchivist* container:
```bash
docker exec -it tubearchivist python
```
Then execute these lines to trigger a background task for a full metadata refresh for all channels.