+5
Under review

The "All currently reading comics" mod for Plex theme

starcrouz 4 years ago updated 2 years ago 24

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).

Image 598

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"

Image 599The "Currently reading" page

Image 600The "want to read" page

Image 601The "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 :

Image 602

and select this theme in the Ubooquity admin page :

Image 603

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

Hello
I tested your mod under windows and it works very well.
I use Ubooquity on a Synology with a linuxserver/ubooquity docker.

nothing happens when I press the buttons.

I couldn't make it work, have you already used your mod with docker.
thanks

Yes, I had to change the spots where comicid[2] appears in the code to  comicid[3] in order to get it to work correctly because this is assuming the structure of your URL. There is a function in the Comixology 2 Theme that could be used to make this mod work for both types of URLs. I would post the code but I added this these buttons and the progress bar to the other theme. In doing so I have made a lot more changes than just the one that you need. 

+1

Alternatively there is a setting in the advanced page of the admin portal. The setting is called Reverse proxy prefix. Yours should be set to say ubooquity. If you change this field to instead be blank your url would become http://192.168.1.100:2202/comics/. Which is what the code in this theme mod is expecting.

I deleted "ubooquity" in "reverse proxy prefix" and everything works fine!

Thank you very much Cford you have solved my problem

Happy new year & thank you for this great theme!

The remark from Cford 50 also helped me to get the "magic" of the buttons working in Docker.

Unfortunately, I have 3 issues:


1) I am a noob and I do not get how to "mark" a specific comic as "want-to-read", "reading" or "read".

And your instruction video above doesn't seem to load anymore.

From what I have gathered by testing:

"reading" = if you have opened the comic (in the Ubooquity reader) further than page ???

"read" = if you have opened the comic and closed it while being on the last page.

"want-to-read" = it seems linked to opening the comic and closing it while being at the "start". But no idea until which page it considers it as the "start" of the comic. It is definitely further than page 1 in the cases I tested.

Can you clarify this topic for "simple" users?

Thank you in advance.

2) The loading of the comics in the Ubooquity reader takes much longer than using the standard Ubooquity theme.

Can your theme influence this process?

3) The Display Settings seem to be constantly overwritten when triggering one of your status buttons.

I like to have my "Sorting criterion" on "Path", but each time it is reset on "Date".

Is this also due to your theme?

Happy new year too !

1/ The instructions are in the first post of this thread : 

"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"

2/ Haven't seen this problem myself. Could you send me a short video to compare loading of the same comics in this theme compared with an other ? You could open a ticket on github if you prefer.

3/ My own sorting criterions are on "path". Pushing the buttons, it stays on "path". Don't have this issue. Do you press "apply" after changing the options ?