Skip to content

Commit

Permalink
Fix: Reading progress was saved in different location when activating…
Browse files Browse the repository at this point in the history
… show full path
  • Loading branch information
ollm committed Oct 17, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
miri64 Martine Lenders
1 parent 8855fbe commit 72e8cc1
Showing 4 changed files with 24 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Improved touch screen navigation (swipe gesture, 2 finger zoom and reset zoom with 2 finger click) [`f848463`](https://github.com/ollm/OpenComic/commit/f84846399f1521c736b9b6e048f204513ac304da)
- Improved detection of image edges when zoom is applied [`e7ec771`](https://github.com/ollm/OpenComic/commit/e7ec77104360b1e2ac2aa96d97b6c1d2cc2d6d01)
- Frameless window (Full only in Windows and macOS) [`9c7346c`](https://github.com/ollm/OpenComic/commit/9c7346cb37fe3c7aed9200d49e27ed4c5bdbfc96)
- Translate page names in PDFs
- Translate page names in PDFs [`8855fbe`](https://github.com/ollm/OpenComic/commit/8855fbefd498352cc86e014677b19c160fcc8da5)

##### 🐛 Bug Fixes

@@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- RAR error on extract with files some special chars (Changed unrar to node-unrar-js) [`694fe27`](https://github.com/ollm/OpenComic/commit/694fe274982c0a9ad2421c6b226abceae1602c3a)
- Cannot open filtered files with the keyboard [`f831749`](https://github.com/ollm/OpenComic/commit/f8317499a40e6fa45a75988ee1bea31a9135c9bf)
- Some display errors when applying global zoom [`92b28c2`](https://github.com/ollm/OpenComic/commit/92b28c24f1a00544264fac03a336ad8268553fd5)
- Reading progress was saved in different location when activating show full path

## [v1.0.0-beta.3](https://github.com/ollm/OpenComic/releases/tag/v1.0.0-beta.3) (09-10-2023)

19 changes: 17 additions & 2 deletions scripts/dom.js
Original file line number Diff line number Diff line change
@@ -313,6 +313,8 @@ async function loadIndexPage(animation = true, path = false, content = false, ke

if(!path)
{
dom.fromLibrary(true);

indexPathControl(false);

let sort = config.sortIndex;
@@ -414,7 +416,7 @@ async function loadIndexPage(animation = true, path = false, content = false, ke
comics[key].sha = sha1(comics[key].path);
comics[key].poster = images.poster;
comics[key].images = images.images;
comics[key].mainPath = config.showFullPathLibrary ? p.parse(comics[key].path).root : comics[key].path;
comics[key].mainPath = comics[key].path;
comics[key].readingProgress = readingProgress[comics[key].path] || {lastReading: 0};
}

@@ -561,9 +563,21 @@ function returnTextPath(path, mainPath, image = false)
return path.join(image ? '<i class="material-icon navegation">chevron_right</i>' : ' / ');
}

var isFromLibrary = true;

function fromLibrary(value)
{
isFromLibrary = value;
}

function headerPath(path, mainPath)
{
mainPathR = addSepToEnd(p.dirname(mainPath));
let _mainPath = mainPath;

if((config.showFullPathLibrary && isFromLibrary) || (config.showFullPathOpened && !isFromLibrary))
_mainPath = p.parse(path).root;

mainPathR = addSepToEnd(p.dirname(_mainPath));

var files = path.replace(new RegExp('^\s*'+pregQuote(mainPathR)), '').split(p.sep);

@@ -1547,6 +1561,7 @@ module.exports = {
currentPathScrollTop: function(){return currentPathScrollTop},
getFolderThumbnails: getFolderThumbnails,
translatePageName: translatePageName,
fromLibrary: fromLibrary,
search: search,
this: domManager.this,
query: domManager.query,
6 changes: 4 additions & 2 deletions scripts/opencomic.js
Original file line number Diff line number Diff line change
@@ -1005,6 +1005,8 @@ function openComicDialog(folders = false)

}

var fromLibrary = true;

function openComic(filePath, animation = true)
{
if(pathIsSupported(filePath))
@@ -1035,13 +1037,13 @@ function openComic(filePath, animation = true)
if(mainPath === false)
mainPath = path;

mainPath = config.showFullPathOpened ? p.parse(mainPath).root : mainPath;

if(onReading)
reading.saveReadingProgress();

recentlyOpened.set(mainPath);

dom.fromLibrary(false);

if(selectImage)
dom.openComic(animation, path, mainPath);
else
1 change: 1 addition & 0 deletions scripts/recently-opened.js
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ async function reload()

async function load(animation = true, content = false)
{
dom.fromLibrary(false);
dom.indexPathControl(false, false, false, false, true);

template.loadContentRight('index.content.right.loading.html', animation);

0 comments on commit 72e8cc1

Please sign in to comment.