Skip to content

Commit

Permalink
Fucking RIP chatp volume resets
Browse files Browse the repository at this point in the history
  • Loading branch information
holycardboard committed Nov 25, 2023
1 parent d0484dc commit 74c7001
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/composables/manga-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ export const useMangaApi = () => {
return put<void>(`manga/display-title`, { id: id.toString(), title });
}

const setOrdinalReset = (id: string | number, reset: boolean) => {
return put<void>(`manga/ordinal-reset`, { id: id.toString(), reset });
}

return {
fetch,
random,
Expand All @@ -196,6 +200,8 @@ export const useMangaApi = () => {
strip,
markAsRead,
since,
setDisplayTitle
setDisplayTitle,
setOrdinalReset,

};
};
1 change: 1 addition & 0 deletions src/models/manga/manga.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface Manga extends DbObject {
referer?: string;
displayTitle?: string;
uploader?: number;
ordinalVolumeReset: boolean;

attributes: {
name: string;
Expand Down
25 changes: 24 additions & 1 deletion src/pages/manga/[id]/admin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@
/>
</div>
</div>
<div class="title-select margin flex row rounded">
<div class="flex">
<CheckBox v-model="manga.ordinalVolumeReset" label="Chapter numbers reset between volumes" />
<p class="alt flex center-vert pad-left mute-light">This will fix some bad volumized requests</p>
<IconBtn
icon="save"
text="Save Oridnal Reset"
color="primary"
@click="saveReset"
other-classes="margin-left"
/>
</div>
</div>
</div>
</div>
Expand All @@ -42,7 +55,8 @@
import { VolumeSort } from '~/models';
const {
volumed,
setDisplayTitle
setDisplayTitle,
setOrdinalReset,
} = useMangaApi();
const { toPromise } = useApiHelper();
Expand All @@ -69,6 +83,15 @@ const saveTitle = async () => {
await refresh();
}
const saveReset = async () => {
if (!manga.value) return;
rawLoading.value = true;
await toPromise(setOrdinalReset(manga.value.id, manga.value.ordinalVolumeReset));
rawLoading.value = false;
await refresh();
}
watch(() => data.value, () => {
selectedTitle.value = manga.value?.displayTitle ?? manga.value?.title ?? '';
}, { immediate: true });
Expand Down

0 comments on commit 74c7001

Please sign in to comment.