Fix torrent path
Need also update deps
This commit is contained in:
parent
a05de0640f
commit
af6a581f96
6 changed files with 86 additions and 9 deletions
|
@ -12,3 +12,14 @@ def config_route():
|
|||
config[section] = dict(config[section])
|
||||
|
||||
return jsonify(config)
|
||||
|
||||
@api_bp.route("/api/config/<section>/<element>/<value>")
|
||||
def config_edit_route(section: str, element: str, value: str):
|
||||
config = initiate_config()
|
||||
|
||||
config = config.app_config
|
||||
config[section][element] = value
|
||||
with open("data/app.ini", "w") as f:
|
||||
config.write(f)
|
||||
|
||||
return jsonify({"result": True})
|
||||
|
|
|
@ -61,6 +61,7 @@ def add_route():
|
|||
index=int(request.json["episodeIndex"].split(".")[0]),
|
||||
correction=int(request.json["adjustedEpisodeNumber"]),
|
||||
title=request.json["dirname"],
|
||||
path=request.json["filepath"],
|
||||
)
|
||||
|
||||
config.args = requestData
|
||||
|
@ -108,7 +109,7 @@ def edit_route():
|
|||
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"]
|
||||
|
|
|
@ -5,6 +5,7 @@ class RequestData:
|
|||
correction: int = 0
|
||||
title: str = ""
|
||||
codename: str = ""
|
||||
path: str = ""
|
||||
force: bool = False
|
||||
|
||||
def __init__(
|
||||
|
@ -15,6 +16,7 @@ class RequestData:
|
|||
correction=0,
|
||||
title="",
|
||||
codename="",
|
||||
path="",
|
||||
force=False,
|
||||
):
|
||||
self.url = url
|
||||
|
@ -23,4 +25,5 @@ class RequestData:
|
|||
self.correction = correction
|
||||
self.title = title
|
||||
self.codename = codename
|
||||
self.path = path
|
||||
self.force = force
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
</nav>
|
||||
</dialog>
|
||||
|
||||
<dialog class="active" v-if="Object.keys(editFormData).length > 0">
|
||||
<dialog :class="{ 'active': Object.keys(editFormData).length > 0 }">
|
||||
<h5 class="primary-text">Редагування</h5>
|
||||
<form @submit.prevent="editTitle" class="grid">
|
||||
<div class="field label prefix border s12">
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
</article>
|
||||
|
||||
<article class="primary-text">
|
||||
<a class="row wave">
|
||||
<a class="row wave" @click="openDialog('login')">
|
||||
<i>person</i>
|
||||
<div class="max">
|
||||
<h6 class="small">Логін</h6>
|
||||
|
@ -26,7 +26,7 @@
|
|||
</div>
|
||||
</a>
|
||||
<hr>
|
||||
<a class="row wave">
|
||||
<a class="row wave" @click="openDialog('password')">
|
||||
<i>password</i>
|
||||
<div class="max">
|
||||
<h6 class="small">Пароль</h6>
|
||||
|
@ -34,7 +34,7 @@
|
|||
</div>
|
||||
</a>
|
||||
<hr>
|
||||
<a class="row wave">
|
||||
<a class="row wave" @click="openDialog('hub')">
|
||||
<i>hub</i>
|
||||
<div class="max">
|
||||
<h6 class="small">Торрент клієнт</h6>
|
||||
|
@ -42,7 +42,7 @@
|
|||
</div>
|
||||
</a>
|
||||
<hr>
|
||||
<a class="row wave">
|
||||
<a class="row wave" @click="openDialog('directory')">
|
||||
<i>description</i>
|
||||
<div class="max">
|
||||
<h6 class="small">Директорія завантажень</h6>
|
||||
|
@ -50,7 +50,7 @@
|
|||
</div>
|
||||
</a>
|
||||
<hr>
|
||||
<a class="row wave">
|
||||
<a class="row wave" @click="openDialog('delay')">
|
||||
<i>hourglass_top</i>
|
||||
<div class="max">
|
||||
<h6 class="small">Затримка</h6>
|
||||
|
@ -62,6 +62,24 @@
|
|||
<hr>
|
||||
</article>
|
||||
|
||||
<dialog :class="{ 'active': isDialogOpen }">
|
||||
<h5 class="primary-text">Редагування</h5>
|
||||
<form @submit.prevent="editTitle" class="grid">
|
||||
<div class="field label prefix border s12">
|
||||
<i>folder</i>
|
||||
<input type="text" v-model="dialogValue" placeholder="Назва директорії" required />
|
||||
<label>Назва директорії</label>
|
||||
</div>
|
||||
<nav class="right-align small-padding s12">
|
||||
<button class="border small-round" @click="closeDialog">
|
||||
<i>cancel</i>
|
||||
</button>
|
||||
<button class="border small-round" type="submit">
|
||||
<i>edit</i>
|
||||
</button>
|
||||
</nav>
|
||||
</form>
|
||||
</dialog>
|
||||
|
||||
</template>
|
||||
|
||||
|
@ -70,6 +88,9 @@ import axios from 'axios';
|
|||
export default {
|
||||
data() {
|
||||
return {
|
||||
isDialogOpen: false,
|
||||
dialogValue: '',
|
||||
currentField: ''
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -77,9 +98,50 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
goBack() {
|
||||
this.$router.back();
|
||||
},
|
||||
openDialog(field) {
|
||||
this.currentField = field;
|
||||
this.dialogValue = field; // очищаем значение при открытии диалога
|
||||
this.isDialogOpen = true;
|
||||
},
|
||||
closeDialog() {
|
||||
this.isDialogOpen = false;
|
||||
},
|
||||
async editTitle() {
|
||||
try {
|
||||
// Здесь можно установить URL вашего API
|
||||
const response = await fetch(`https://your-api-endpoint/${this.currentField}`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
value: this.dialogValue
|
||||
})
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
// Обработка ответа сервера (если необходимо)
|
||||
console.log(data);
|
||||
|
||||
this.closeDialog();
|
||||
} catch (error) {
|
||||
console.error('Ошибка:', error);
|
||||
}
|
||||
},
|
||||
goBack() {
|
||||
this.$router.back();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -1 +1 @@
|
|||
{"root":["./src/main.ts","./src/vite-env.d.ts","./src/App.vue","./src/components/Navbar.vue","./src/pages/index.vue"],"version":"5.6.2"}
|
||||
{"root":["./src/main.ts","./src/vite-env.d.ts","./src/App.vue","./src/components/Navbar.vue","./src/pages/about.vue","./src/pages/add.vue","./src/pages/index.vue","./src/pages/settings/account.vue","./src/pages/settings/bittorrent.vue","./src/pages/settings/debug.vue","./src/pages/settings/index.vue","./src/pages/settings/palette.vue"],"version":"5.6.2"}
|
Loading…
Reference in a new issue