
@@ -139,15 +157,19 @@
}
function exportWatchlistCSV() {
- const entries = {{json .AllEntries}};
- if (!entries || entries.length === 0) {
+ const items = document.querySelectorAll('.watchlist-item');
+ if (items.length === 0) {
alert('Watchlist is empty');
return;
}
let csv = 'anime_id,status,current_episode,current_time_seconds\n';
- entries.forEach(e => {
- csv += `${e.AnimeID},${e.Status},${e.CurrentEpisode.Int64},${e.CurrentTimeSeconds}\n`;
+ items.forEach(function(item) {
+ const animeId = item.querySelector('a').href.split('/').pop();
+ const status = item.dataset.status || 'plan_to_watch';
+ const episode = item.dataset.episode || '0';
+ const time = item.dataset.time || '0';
+ csv += `${animeId},${status},${episode},${time}\n`;
});
const blob = new Blob([csv], { type: 'text/csv' });
diff --git a/templates/watchlist_partial.gohtml b/templates/watchlist_partial.gohtml
index b0b5c36..54815d3 100644
--- a/templates/watchlist_partial.gohtml
+++ b/templates/watchlist_partial.gohtml
@@ -32,18 +32,26 @@
-
-
-
-
-
-
+
+
+
+
+
+