diff --git a/app/api/titles.py b/app/api/titles.py index 45085d3..5b1e05c 100644 --- a/app/api/titles.py +++ b/app/api/titles.py @@ -100,3 +100,22 @@ def update_route(codename): except Exception as e: message = f"Error: {str(e)}" return {"error": message} + +@api_bp.route("/api/edit", methods=["POST"]) +def edit_route(): + config = initiate_config() + titles = config.titles_config + for title in titles.sections(): + if titles._sections[title]["hash"] != request.json["hash"]: + continue + + titles._sections[title]["episode_index"] = request.json["episodeIndex"] + titles._sections[title]["season_number"] = request.json["seasonNumber"] + titles._sections[title]["torrent_name"] = request.json["torrentName"] + titles._sections[title]["download_dir"] = request.json["downloadDir"] + titles._sections[title]["publish_date"] = request.json["publishDate"] + titles._sections[title]["adjusted_episode_number"] = request.json["adjustedEpisodeNumber"] + with open("data/titles.ini", "w") as f: + titles.write(f) + + return jsonify({"result": True}) diff --git a/frontend/package.json b/frontend/package.json index 12ef90e..609a914 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "frontend", "private": true, - "version": "1.0.4", + "version": "1.0.5", "type": "module", "scripts": { "dev": "vite", diff --git a/frontend/src/components/TitleCard.vue b/frontend/src/components/TitleCard.vue index afc6c06..2135b31 100644 --- a/frontend/src/components/TitleCard.vue +++ b/frontend/src/components/TitleCard.vue @@ -48,6 +48,9 @@ export default { }, deleteTitle() { this.$emit('delete-title', this.title.codename); + }, + editTitle() { + this.$emit('edit-title', this.title.codename); } } } diff --git a/frontend/src/pages/about.vue b/frontend/src/pages/about.vue index 5c52d8a..8dc2f05 100644 --- a/frontend/src/pages/about.vue +++ b/frontend/src/pages/about.vue @@ -8,9 +8,9 @@
Зручний сайт для завантаження аніме до медіасерверу Jellyfin
diff --git a/frontend/src/pages/index.vue b/frontend/src/pages/index.vue index 700486f..e044678 100644 --- a/frontend/src/pages/index.vue +++ b/frontend/src/pages/index.vue @@ -29,8 +29,9 @@ -