diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 206029a4..d156164a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -240,3 +240,19 @@ services: ``` If you want to run queries on the Elasticsearch container directly from your host with for example `curl` or something like *postman*, you might want to **publish** the port 9200 instead of just **exposing** it. + +**Persist Token** +The token will get stored in ES in the `config` folder, and not in the `data` folder. To persist the token between ES container rebuilds, you'll need to persist the config folder as an additional volume: + +1. Create the token as described above +2. While the container is running, copy the current config folder out of the container, e.g.: +``` +docker cp archivist-es:/usr/share/elasticsearch/config/ volume/es_config +``` +3. Then stop all containers and mount this folder into the container as an additional volume: +```yml +- ./volume/es_config:/usr/share/elasticsearch/config +``` +4. Start all containers back up. + +Now your token will persist between ES container rebuilds. diff --git a/backend/channel/serializers.py b/backend/channel/serializers.py index d47218f1..568e4eed 100644 --- a/backend/channel/serializers.py +++ b/backend/channel/serializers.py @@ -42,7 +42,9 @@ class ChannelSerializer(serializers.Serializer): channel_overwrites = ChannelOverwriteSerializer(required=False) channel_subs = serializers.IntegerField() channel_subscribed = serializers.BooleanField() - channel_tags = serializers.ListField(child=serializers.CharField()) + channel_tags = serializers.ListField( + child=serializers.CharField(), required=False + ) channel_views = serializers.IntegerField() _index = serializers.CharField(required=False) _score = serializers.IntegerField(required=False) diff --git a/backend/channel/src/index.py b/backend/channel/src/index.py index b2aa688c..77d8cf27 100644 --- a/backend/channel/src/index.py +++ b/backend/channel/src/index.py @@ -57,7 +57,7 @@ class YoutubeChannel(YouTubeItem): self.youtube_meta["thumbnails"].reverse() self.json_data = { "channel_active": True, - "channel_description": self.youtube_meta.get("description", False), + "channel_description": self.youtube_meta.get("description", ""), "channel_id": self.youtube_id, "channel_last_refresh": int(datetime.now().timestamp()), "channel_name": self.youtube_meta["uploader"], @@ -116,7 +116,7 @@ class YoutubeChannel(YouTubeItem): "channel_id": self.youtube_id, "channel_subscribed": False, "channel_tags": [], - "channel_description": False, + "channel_description": "", "channel_thumb_url": False, "channel_views": 0, } diff --git a/backend/download/serializers.py b/backend/download/serializers.py index 2db47710..2ae56bb7 100644 --- a/backend/download/serializers.py +++ b/backend/download/serializers.py @@ -22,6 +22,7 @@ class DownloadItemSerializer(serializers.Serializer): vid_thumb_url = serializers.CharField() vid_type = serializers.ChoiceField(choices=VideoTypeEnum.values()) youtube_id = serializers.CharField() + message = serializers.CharField(required=False) _index = serializers.CharField(required=False) _score = serializers.IntegerField(required=False) diff --git a/frontend/src/pages/ChannelAbout.tsx b/frontend/src/pages/ChannelAbout.tsx index b23e68a8..b346964b 100644 --- a/frontend/src/pages/ChannelAbout.tsx +++ b/frontend/src/pages/ChannelAbout.tsx @@ -222,7 +222,7 @@ const ChannelAbout = () => { )} - {channel.channel_tags.length > 0 && ( + {channel?.channel_tags && channel.channel_tags.length > 0 && (
{channel.channel_tags.map(tag => { diff --git a/frontend/src/pages/Channels.tsx b/frontend/src/pages/Channels.tsx index 0ec3bbc9..711bae77 100644 --- a/frontend/src/pages/Channels.tsx +++ b/frontend/src/pages/Channels.tsx @@ -36,7 +36,7 @@ export type ChannelType = { channel_overwrites?: ChannelOverwritesType; channel_subs: number; channel_subscribed: boolean; - channel_tags: string[]; + channel_tags?: string[]; channel_thumb_url: string; channel_tvart_url: string; channel_views: number;