+7

Adding Currently Reading label to comics

lostndessence 5 years ago updated by ListerD 5 years ago 27

Hello, I'm new to Ubooquity and I've taken to using it primarily for comics. With so many to sort through, it can be hard to keep track of where you are in any given series. So I've been trying to figure out how to mark them as Read or Started Reading. I couldn't find any solutions online or here on the forum so I decided to try doing it myself. (However if this info was already out there, please let me know)

This solution is currently only tested in the plex theme for Ubooquity as that's the theme I use, and only works for comics.

This Theme: https://ubooquity.userecho.com/communities/1/topics/666-plex-based-theme

Through tweaking and digging in the code, I discovered that a GET pathway exists where one can request some data if they have the id of a comic. That path looks like this:

host_name:port/user-api/bookmark?docId=****

where host_name is your ip or domain, port is the port, and **** is the id of the comic.

The returned JSON looks like this:

{

"docId" : 3326,

"isBook" : false,

"mark" : "0",

"isFinished" : false,

"lastUpdate" : 1576387903971

}

It's important to note that "mark" in the above JSON is the current page saved in the bookmark of that particular comic. Therefore, using a GET request we can determine if a comic has been started or not based on that value. Also, if a comic has never been opened, the GET request will return null.

The last bit of information we need is where to get that ID for the comic, and this can be found by looking at the source url of the cover image displayed. It will say /comics/****/comic_filename?params (again where **** is the comic id).

The following JS code will loop through all of the comics (exluding folders) on the current page, make a GET request for each, and (so long as the value of mark is not 0 or null) will add a "reading" label.

///////////////////

//MODS

///////////////////

// Anonymous "self-invoking" function

(function() {

var startingTime = new Date().getTime();

// Load the script

var script = document.createElement("SCRIPT");

script.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';

script.type = 'text/javascript';

document.getElementsByTagName("head")[0].appendChild(script);

// Poll for jQuery to come into existance

var checkReady = function(callback) {

if (window.jQuery) {

callback(jQuery);

}

else {

window.setTimeout(function() { checkReady(callback); }, 20);

}

};

// Start polling...

checkReady(function($) {

//////////////////////////////////

//Add currently reading condition to comic

//////////////////////////////////

$('.thumb a img').each(function(){

raw_src = $(this).attr('src')

page_num = '0';

//sort comics from folders

if (raw_src.search("folder") >= 0){

//console.log("raw_src: "+raw_src);

} else {

//extract Comic ID

thing = $(this);

src = $(this).attr('src');

//console.log("source: "+src);

$(this).closest('.thumb').append('');

var comicid = src.split('/');

//console.log("Comic ID: "+comicid[2]);

//get comic meta from server

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

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

$.getJSON( json_url, function() {

console.log( "success" );

}).done(function( data ) {

current_this = thing;

if (data != null){

var items = [];

var c_id = '';

$.each( data, function( key, val ) {

if (key == 'docId'){c_id = val;}

if (key == 'mark'){

page_num = val;

if (page_num != '0'){

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

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

}

//console.log("page_num "+page_num);

}

});

}

}).fail(function(){});

}

//console.log("triggered");

});

});

})();

// end Anonymous "self-invoking" function

Add this script at the bottom of themeScript.js in the plextheme files. Note: This script can only determine if the comic has been started, not when it is completed. So to clear the "reading" label, simply return the comic to page 1 and exit it. I also added some styles to make the label itself look ok. This can be added to comics.css

.reading{ bottom: 0; background-color: #009218 !important; top: initial !important;}

Anyone with knowledge of js and css should be able to modify this for their own favorite theme, or hopefully this can help someone more clever than me develop a universal script that can do the same thing for everyone.

Image 589

+7

Suggestion: Deck

Ovidiu Constantin 6 years ago 0

I might think of this the wrong way, so if this functionality already exists elsewhere, please set me on the right path. I usually finish a larger book in 2-3-....-100 reading sessions. My folder structure is quite large (large collection and all) so I have to remember what I was reading and where it is located (or search for it). It would be great if I could find what I was reading in a "On Deck" section in the homepage. Stuff could get there automatically (if you read more than 2 pages, let's say), but I won't mind a simple "Pin  to Deck" (and Unpin) / favourites / bookmarks, etc... Thank you!

+7
Completed

"ComicViewer for Ubooquity" now available on Google Play Store

Seth Chhim 8 years ago updated by Maahi Pal 7 years ago 99



Google Play Link


Check out my app, it is a webview wrapper that gives Ubooquity viewing two additional features. Immersive fullscreen and swipe-to-turn page. I have been using it for a week and it makes a big difference in my viewing experience. Free, No ads or unnecessary permissions.


Due to request of Tom, I have renamed the app and included a non affiliation disclosure. I would like to learn more about Ubooquity and make a full client one day, so if anyone can post documentation I can read please provide it. I use your server software almost everyday and its been great so I would like to give back and contribute.

+7
Planned

[Feature Request] Ability to group by/sort by ebook metadata

Doug Crowe 9 years ago updated by Zack Weishaus 8 months ago 7

Could we have the ability to use metadata tagged with Calibre to group books by? Such as options to use Series rather than Author, or Series as a sub category under author?

+7
Planned

mark readed comics

christophe B 9 years ago updated by Deraja B 4 years ago 11

Hello


Do you think it is possible in the future to have an option that allows us to manually set a flag read/unread on a comics or a pdf file ?


thanks

+6
Planned

Better search fields

Are Finstad 10 years ago updated by Mr. SimPle (asd) 7 years ago 4
the Search fields should be able to access metadata from our comics/books and not just the series name.
the search field should try to find hits in all metadata fields (Writer, Publisher, Characters, Synopsis, Genre, Tags and so on)

the search field should also let the user pick what type of search you are doing (if you are searching for just one metadata field)

say if i search for Batman in my Comic collection, it will only find comics with Batman in the series name field and not anywhere else like Detective Comics (which Batman is the main character off) even tho the name Batman is in almost every Synopsis and Character field of the comics in series.
+6
Planned

Sort by filename

nxmehta 10 years ago updated by Jørn Tillnes 3 years ago 21
It would be great if we could sort by filename in addition to Author/Date.  Thanks.
+5
Under review

The "All currently reading comics" mod for Plex theme

starcrouz 5 years ago updated 3 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

+5

Few suggestions. (probably already suggested ... )

mootoomoo 7 years ago updated 6 years ago 2

Adding one or two of those suggestions make me feel very happy :)

- Read/unread status on the thumbnails

- or percentage of page already red

- Stars or notation with maybe an automatic purge for the worst.

- A kind of "safe for kid" flag (ok, i have already asked for it and you refused, but i dont find a way to manage folder properly for my little nephew :( ... and personnaly i'd like to access to my complete library without asking to myself if i'll read an adult or a kid book)

- Maybe an "ended serial" because it's always sad to start a story with no end ...


Tom, they are just ideas, it'll be great to find those features in the nexts releases but it's not an obligation. And be sure I really appreciate what you have already done for us. Thank you again Monsieur.

+5
Under review

Thank You, Tom!

Bobby Hill 8 years ago updated 7 years ago 7

Tom, I just wanted to say Thank You. Not only for this program, but for sharing it with everyone, and for the awesome updates.


I've been loving this program as my Comic server for a while now, and there is nothing else out there that even comes close to comparing with Ubooquity.


Also, I've been trying to find a good audiobook server out there, but there aren't any. What I ended up doing was adding the directory to the Raw Files section of Ubooquity.  I download them at work when I'm on a new book, play them on Windows Media Player, and everything's super smooth.