+5
Under review

The "All currently reading comics" mod for Plex theme

starcrouz 5 months ago updated by Ameel Beesony 2 months ago 17

Hi,

I like a lot Ubooquity but I miss a lot a "currently reading" list of comics. There is already a mod by lostndessence (on the Plex theme) with a currently reading status which is usefull but no way to see all these comics on the same page/list.

I took the moded Plex theme by lostndessence, added a mod (the deduplicator by me) and now I added 3 news features :

- show all currently reading comics

- show all comics already reads

- show comics you want to read

On the top menu, there is now 3 news icons. When you clic one, the local page get (in javascript) the reading status of all your comics (it can take a little time).

To use these new features, it is very easy :

- if a comic bookmark is at page 2, it is considered as "want to read",

- if a comic bookmark is at the last page, it is considered as "read"

- if a comic bookmark is between page 3 and last page - 1, it is considered as "currenly reading"

The "Currently reading" page

The "want to read" page

The "read comics" page

I made a little video to show how it works :

INSTALL INSTRUCTIONS : 

To install the theme, just DOWNLOAD IT, unzip it in the "themes" folder of your Ubooquity program. I should look like :

and select this theme in the Ubooquity admin page :

And push "save ans restart" button on the top right of the admin page

Hope you will enjoy. Tell me if you find bugs. I'm using it on a regular basis for a month now.

Starcrouz

Under review

Wow, great work !

Perfect! Thank you very much! Good word!

Love the theme. Having some trouble with the time it takes to process. Its taking me about 220secs to process 26000 BD. What are BDs? Is there any way I can speed this up?

In my case it takes 15s : I have ~1500 comics.

It is very long if your library is big like yours because the script needs to make an http request to the server for each comic.  I may be able to speed the process caching the requests (using the browser cache) to avoid doing this each time you access the page. 

The fact is, because Ubooquity doesn't provide any "currently reading" webservice, the script have no other choice but to ask the server for every comic status.

I will find a way to speed this up.

About the "BDs", sorry, it is the french word for "comics" : Bande Dessinée = Comic Strip. I will replace this term in the next version.

Thanks for the quick response. I was confused about the BD because I have about 9000 comics and the BD number was nowhere near this. I rebuilt my database and it now just counts to 9000 BD in about 80 secs.

Caching this would be great. Thanks for your effort. Really appreciate your work.

Great. Good idea to Rebuild your database. 


Rebuild your database is efficient because Ubooquity let more and more empty indexes between comics after time (when you remove comic or when you rename them). As for you, it used 25000 index to store 9000 comics. The script don't know where the comics are, therefore it needs to parse all indexes (25000) to find the comics (9000). 

When you rebuild you database, old indexes are all abandonned, I think Ubooquity uses only new indexes (starting after the last used index (25000 for you). I imagine that now, all your comics are stored in the Ubooquity database from 25000 to 34000. That is the meaning of the growing indicator I display here : as you can read, 11357 is the scanned index in the database, not the comic count. I may change that in the future release of the script to obtain the real count of comics.

Hi,

This is a major update of the "All currently reading comics" mod for Plex theme.

I added a cache to avoid a too long waiting when the scan is in process. Now it is extremely fast to get the currently reading books. You could clear the cache from time to time when it is too old (update link).

At the same time I tried to show better indicators for the bookmarks.

Scanning all comics in progress...

All currently reading comics : the cached list. 

Hope it will be helpfull.

This is the new file to install the theme (instructions are the same as before) : Download it.

Starcrouz

Hey Starcrouz, just testing out your update and its working great. The cache makes it super fast to use now. Love It. Thanks for all your hard work!

This is fantastic. Could I request/suggest some additional features if possible:

  1. option to mark comic as read without opening and scrolling to the end
  2. settings option to hide (or shift to the 'back' of the list, or last page) comics that are 'read'
  3. settings option to click to open comic directly/immediately, rather than click to choose download or read
  4. settings option for selecting top, bottom, or both positions for list browse navigation menu (rather than bottom only)
    1. Not trying to break anything, but a 'dirty' mod to add page navigation at the top: is to add pagination code after class 'navigation', e.g: amend following text in themeScript.js:

(n="hidden"),o()("#group").after(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return'\n 3&&void 0!==arguments[3]?arguments[3]:"")+">\n "+t+" "+e+" "+n+"\n \n "}(r,e,t,n))

to:

(n="hidden"),o()("#group").after(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return'\n 3&&void 0!==arguments[3]?arguments[3]:"")+">\n "+t+" "+e+" "+n+"\n \n "}(r,e,t,n)) ||(n="hidden"),o()(".navigation").after(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return'\n 3&&void 0!==arguments[3]?arguments[3]:"")+">\n "+t+" "+e+" "+n+"\n \n "}(r,e,t,n))

I haven't looked at the code yet, but I would be happy to assist and contribute to the development.

/edited.

+1

Hi Ameel,

Great the theme is usefull for you ! And yes, could be great to code together !

About your requests/suggests

1/ Yes, I would like it too

2/ easy

3/ good idea

4/ easy too. I don't like it at the bottom too, it is not practical

I made a repo to allow modification of the code : https://github.com/starcrouz/plextheme-reading

Fantastic. I'll look at the repo later.

I'm not familiar with how settings are saved/loaded/applied. Any pointers?

Cheers

A quick way to hide "read" books from a folder without much modification of code. 


In themeScript.js, search for code:

$("img[src*='"+c_id+"']").closest('.thumb').find('.numberblock').addClass("reading");


then, add immediately after:

//if book is read, display none
if (mark == nb_of_pages){
//Hide by adding new css style to item selected by title
$("div[title='" + decodeURI(book_name) + "']").css("display","none");
console.log("Hid " + decodeURI(book_name));;
}


This is definitely not the best way to do it as you will end up having empty pages. The ideal way would be to exclude book results for books that are read. I haven't/am not going into the code that deeply yet.

+1

/edited. will post after

I made a repo to allow modification of the code : https://github.com/starcrouz/plextheme-reading

Cool. I'll have a look after, but my proposed codes aren't quite suitable for normal implementation

A quick way to open comic directly/immediately, rather than click on comic to show pop-up to choose download or read without much modification of code:

In themeScript.js, search for code:

json_url = window.location.origin+"/user-api/bookmark?docId="+comicid[2];

console.log("url: "+json_url);

then, add immediately after:

var html_url = window.location.origin + "/comicdetails/" + comicid[2];

$.get(html_url, function( data_comicdetails ) {

var total_pages = $(data_comicdetails).find("#details_size").text().split("page")[0] * 1;

$("img[src*='"+comicid[2]+"']").parent().prop("href","/comicreader/reader.html#?docId=" + comicid[2] + "&startIndex=0&type=comic&nbPages=" + total_pages + "&storeBookmarksInCookies=false");

$("img[src*='"+comicid[2]+"']").parent().prop("onclick","");

});

The ideal solution would be to have option to turn this on or off.

Made some changes on the repo. Happy to consider better approaches