fixed edit entry modal

This commit is contained in:
2025-12-12 16:55:28 +01:00
parent 1bc651958c
commit 6006a912ec
7 changed files with 23 additions and 28 deletions

View File

@@ -294,13 +294,12 @@ function createListItem(item) {
}
const statusLabels = {
'CURRENT': entryType === 'ANIME' ? 'Watching' : 'Reading',
'WATCHING': entryType === 'ANIME' ? 'Watching' : 'Reading',
'COMPLETED': 'Completed',
'PLANNING': 'Planning',
'PAUSED': 'Paused',
'DROPPED': 'Dropped'
'DROPPED': 'Dropped',
'REPEATING': entryType === 'ANIME' ? 'Rewatching' : 'Rereading'
};
const extraInfo = [];

View File

@@ -5,7 +5,7 @@ const ListModalManager = {
currentEntry: null,
STATUS_MAP: {
WATCHING: 'CURRENT',
CURRENT: 'CURRENT',
COMPLETED: 'COMPLETED',
PLANNING: 'PLANNING',
PAUSED: 'PAUSED',
@@ -15,17 +15,7 @@ const ListModalManager = {
getEntryType(data) {
if (!data) return 'ANIME';
if (data.format) {
const format = data.format.toUpperCase();
if (['MANGA', 'ONE_SHOT', 'MANHWA'].includes(format)) {
return 'MANGA';
}
if (['NOVEL', 'LIGHT_NOVEL'].includes(format)) {
return 'NOVEL';
}
}
if (data.entry_type) return data.entry_type.toUpperCase();
return 'ANIME';
},
@@ -118,6 +108,15 @@ const ListModalManager = {
deleteBtn.style.display = 'none';
}
const statusSelect = document.getElementById('entry-status');
[...statusSelect.options].forEach(opt => {
if (opt.value === 'CURRENT') {
opt.textContent = entryType === 'ANIME' ? 'Watching' : 'Reading';
}
});
if (progressLabel) {
if (entryType === 'ANIME') {
progressLabel.textContent = 'Episodes Watched';
@@ -128,13 +127,6 @@ const ListModalManager = {
}
}
const statusSelect = document.getElementById('entry-status');
[...statusSelect.options].forEach(opt => {
if (opt.value === 'WATCHING') {
opt.textContent = entryType === 'ANIME' ? 'Watching' : 'Reading';
}
});
document.getElementById('entry-progress').max = totalUnits;
document.getElementById('add-list-modal').classList.add('active');
},