Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Server

Notices

Reply
 
Thread Tools Search this Thread
Old 02-27-2023, 04:43 PM   #1
huotg01
Enthusiast
huotg01 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2013
Location: Montreal, Qc, Canada
Device: Moon Reader, Xiaomi Note 10
Content server- Virtual library list: 1 line by library

Hi

I work a lot with the Calibre Content server, and I would like to modify the way the virtual libraries are listed on the web interface (please see attached image).

In fact I just want to display the library name (1), without the search formula (2). The list would then have 1 line by virtual library and would be shorter.

Is it possible ? How ?

Thanks

Gaston
Attached Thumbnails
Click image for larger version

Name:	Virtual lib-Calibre.png
Views:	101
Size:	147.4 KB
ID:	200003  
huotg01 is offline   Reply With Quote
Old 02-27-2023, 09:30 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,108
Karma: 22669824
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You'd have to modify the source code.
kovidgoyal is offline   Reply With Quote
Old 03-01-2023, 05:34 PM   #3
huotg01
Enthusiast
huotg01 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2013
Location: Montreal, Qc, Canada
Device: Moon Reader, Xiaomi Note 10
Thanks kovidgoyal

Do I have access to the source code, and it it something that I can do ?

Gaston
huotg01 is offline   Reply With Quote
Old 03-01-2023, 07:12 PM   #4
huotg01
Enthusiast
huotg01 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2013
Location: Montreal, Qc, Canada
Device: Moon Reader, Xiaomi Note 10
What is the module name ?

Thanks

Gaston
huotg01 is offline   Reply With Quote
Old 03-01-2023, 09:22 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,108
Karma: 22669824
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look for th efunction create_vl_panel
kovidgoyal is offline   Reply With Quote
Old 03-21-2023, 01:52 PM   #6
huotg01
Enthusiast
huotg01 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2013
Location: Montreal, Qc, Canada
Device: Moon Reader, Xiaomi Note 10
Thanks kovidgoyal

I don't find this function...

Could you point me out to the right direction ?

Thanks again,

Gaston
ps: as a reminder, using the web interface, I just want to list the virtual libraries with one line each (don't want to display the filter code).

Last edited by huotg01; 03-21-2023 at 02:16 PM.
huotg01 is offline   Reply With Quote
Old 03-21-2023, 02:26 PM   #7
huotg01
Enthusiast
huotg01 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2013
Location: Montreal, Qc, Canada
Device: Moon Reader, Xiaomi Note 10
Hi kovidgoyal

I finally found out the function in the JavaScript file viewer.js, in the folder Ressources.

1- I don't know what to change to remove the second line (the filter) in the list
2- When the modification is made, what do I have to do the make it work ?

Would you have a minute to help me on that ?

Thanks,

Gaston

Quote:
function create_vl_panel(container_id) {
var container, items, vls, vl_names, name;
if (!library_data.sortable_fields) {
ρσ_interpolate_kwargs.call(this, show_panel, ["book_list"].concat([ρσ_desugar_kwargs({replace: true})]));
return;
}
container = document.getElementById(container_id);
ρσ_interpolate_kwargs.call(this, create_top_bar, [container].concat([ρσ_desugar_kwargs({title: _("Choose Virtual library…"), action: back, icon: "close"})]));
items = ρσ_list_decorate([]);
vls = all_virtual_libraries();
vl_names = Object.keys(vls).sort((function() {
var ρσ_anonfunc = function (a, b) {
return a.toLowerCase().localeCompare(b.toLowerCase());
};
if (!ρσ_anonfunc.__argnames__) Object.defineProperties(ρσ_anonfunc, {
__argnames__ : {value: ["a", "b"]},
__module__ : {value: "book_list.views"}
});
return ρσ_anonfunc;
})());
var ρσ_Iter5 = ρσ_Iterable(vl_names);
for (var ρσ_Index5 = 0; ρσ_Index5 < ρσ_Iter5.length; ρσ_Index5++) {
name = ρσ_Iter5[ρσ_Index5];
items.push(ρσ_interpolate_kwargs.call(this, create_item, [name].concat([ρσ_desugar_kwargs({subtitle: vls[(typeof name === "number" && name < 0) ? vls.length + name : name], action: show_vl.bind(null, name, true)})])));
}
container.appendChild(E.div());
create_item_list(container.lastChild, items, _("Choose a Virtual library to browse from the list below"));
enable_escape_key(container, back);
};
if (!create_vl_panel.__argnames__) Object.defineProperties(create_vl_panel, {
__argnames__ : {value: ["container_id"]},
__module__ : {value: "book_list.views"}
});
huotg01 is offline   Reply With Quote
Old 03-21-2023, 02:31 PM   #8
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,846
Karma: 7035877
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by huotg01 View Post
Thanks kovidgoyal

I don't find this function...

Could you point me out to the right direction ?
src\pyj\book_list\views.pyj, line 404. You want to change line 414.
chaley is offline   Reply With Quote
Old 03-21-2023, 03:16 PM   #9
huotg01
Enthusiast
huotg01 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2013
Location: Montreal, Qc, Canada
Device: Moon Reader, Xiaomi Note 10
Quote:
Originally Posted by chaley View Post
src\pyj\book_list\views.pyj, line 404. You want to change line 414.
Thanks chaley for this answer.
If you have time for a crash course, what do I do from there ? Do I have to rebuilt the whole system with this change ?
I did noticed that the viewer.js is in the Calibre folder on my PC. Is there a way to make a change from there ? In short, what is the fastest way to apply the change ? Can I just "patch" something somewhere ?

Thanks,

Gaston
huotg01 is offline   Reply With Quote
Old 03-21-2023, 03:23 PM   #10
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,846
Karma: 7035877
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by huotg01 View Post
Thanks chaley for this answer.
If you have time for a crash course, what do I do from there ? Do I have to rebuilt the whole system with this change ?
I did noticed that the viewer.js is in the Calibre folder on my PC. Is there a way to make a change from there ? In short, what is the fastest way to apply the change ? Can I just "patch" something somewhere ?

Thanks,

Gaston
Run calibre from source. Make required changes then restart calibre. Loop as needed. I use Eclipse + pydev do do my changes, but a lot of people use other tools. Which depends on the OS you run.

When happy you can create a calibre release, but that is way way way more work. Just keep running from source, accepting new changes from Kovid as you wish.

I have no idea how you would "patch" released calibre to accomplish this. Personally I wouldn't try. I run from source 100% of the time.
chaley is offline   Reply With Quote
Old 03-21-2023, 08:44 PM   #11
huotg01
Enthusiast
huotg01 began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Apr 2013
Location: Montreal, Qc, Canada
Device: Moon Reader, Xiaomi Note 10
Thank you so much for these informations chaley. I will look at that and try this approche.

Gaston
huotg01 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Library and Content Server sbaylor Server 1 01-31-2019 10:33 PM
Creating a Virtual Library on headless content server? dgauvreau Library Management 1 09-11-2018 11:56 AM
Content Server Virtual Library michaelkrg Calibre 11 10-18-2017 11:23 PM
Content Server Library List. revjoe Calibre 1 06-19-2017 12:08 AM
Virtual library on server passegua Library Management 2 04-22-2016 01:54 AM


All times are GMT -4. The time now is 08:48 AM.


MobileRead.com is a privately owned, operated and funded community.