haruneko
haruneko copied to clipboard
Investigate and design a mechanism to check for new chapters/episodes for bookmarks
Todo:
- [ ] Add scheduled checks of new content
- [x] Add option for scheduled check frequency (default 60mins, minimum 10m?)
- [ ] Add desktop notification when new content to view is detected (after initial load).
- [x] Option to disable notification
- [x] Option to disable the "continue" panel on home page
@ronny1982 on this one i was thinking that fully checking all read chapters would be the solution as it would ignore all issue with ordering.
Will have to store the associated language though as not to notify someone reading in french for newer chinese chapter.
Basic solution (only) for bookmarks available in d36f1102, but it will provide all new chapters, ignoring any language specific preferences ...
// Get a website plugin
const sheepscanlations = HakuNeko.PluginController.WebsitePlugins.find(plugin => plugin.Identifier.includes('sheep'));
// Update manga list
await sheepscanlations.Update();
// Get a manga from the list that shall be bookmarked
const manga = await sheepscanlations.Entries[0];
// Update chapter list
await manga.Update();
// Remove a chapter to pretend the list is outdated
manga.Entries.pop();
// Add manga with outdated chapter list to bookmark
await HakuNeko.BookmarkPlugin.Add(manga);
// Get a handle to the bookmark
const bookmark = HakuNeko.BookmarkPlugin.Entries[0];
// Set the current chapter list as "known" chapters (e.g. may be done everytime the user reads the chapter list ...)
await bookmark.ApplyEntriesAsKnownEntries();
// Check for new chapters => this contains the chapter we pretended to not be in the previous list
await bookmark.GetNewEntries();
// Can remove bookmark since it was only for testing purposes ...
await HakuNeko.BookmarkPlugin.Remove(bookmark);
IndexedDB
with Bookmark
Implemented related pattern using in the new itemflagmanager to detect unflagged content https://github.com/manga-download/haruneko/commit/35c812ad174071a1d874ae346cbbf7f15151ffb8 (and further commits) not the same as ApplyEntriesAsKnownEntries but the new unkown entries could be checked against possible previous flag