Bug#807319: gnome-documents: enable additional book types

2016-10-15 Thread Jason Crain
Control: forwarded -1 https://bugzilla.gnome.org/740970

On Mon, Dec 07, 2015 at 04:47:37PM +0530, Ritesh Raj Sarraf wrote:
> Attached is a patch which widens the supported format for GNOME Books.
> This patch adds/enables document type PDF and  COLLECTIONS.
> 
> This is my first time dealing with Javascript so I'm not much versed
> with it. I don't know what COLLECTIONS here is being referred to. But my
> patch will generalize it for all types.
> 
> I think it should be okay to have the book types (PDF and Collection)
> show up under Books too, than not showing/rendering anything at all.

I doubt upstream would accept a patch like that, since I think the idea
for PDFs is that they want a way to manually tag PDFs as being books so
receipts and other things don't show up in gnome books.  There's some
discussion about that in https://bugzilla.gnome.org/704316.



Bug#807319: gnome-documents: enable additional book types

2015-12-07 Thread Ritesh Raj Sarraf
Package: gnome-documents
Version: 3.18.2-1
Severity: wishlist
Tags: patch

Hi,

GNOME Books is supposed to query Tracker and get us results.

Unfortunately, the current version of GNOME Books is very very limited.
The only thing it detects on my machine is CBR files. If I try to make
it open others, it gives me standard message saying "GNOME BOoks is in
preview mode or whatever". Effectively it is not much useful.


Attached is a patch which widens the supported format for GNOME Books.
This patch adds/enables document type PDF and  COLLECTIONS.

This is my first time dealing with Javascript so I'm not much versed
with it. I don't know what COLLECTIONS here is being referred to. But my
patch will generalize it for all types.

I think it should be okay to have the book types (PDF and Collection)
show up under Books too, than not showing/rendering anything at all.


PS: There are some other errors with gnome-{Boook/Documents} but they
don't directly hinder the usability of the tool. For example, when you
select collecitons, nothing is listed. Where as if you put a search
query, you see results.

Hopefully if I read up on Javascript, I'll look into those.


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.3.0+ (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_IN.utf8, LC_CTYPE=en_IN.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages gnome-documents depends on:
ii  dconf-gsettings-backend [gsettings-backend]  0.24.0-2
ii  gir1.2-evince-3.03.18.2-1
ii  gir1.2-gdata-0.0 0.17.3-1
ii  gir1.2-gnomedesktop-3.0  3.18.2-1
ii  gir1.2-goa-1.0   3.18.2.1-1
ii  gir1.2-gtk-3.0   3.18.5-1
ii  gir1.2-tracker-1.0   1.6.1-1
ii  gir1.2-webkit2-4.0   2.10.3+dfsg1-1
ii  gir1.2-zpj-0.0   0.0.3-1+b1
ii  gjs  1.44.0-1
ii  gnome-online-miners  3.14.3-1+b1
ii  libc62.19-22
ii  libcairo-gobject21.14.4-1
ii  libcairo21.14.4-1
ii  libevdocument3-4 3.18.2-1
ii  libevview3-3 3.18.2-1
ii  libgdata22   0.17.3-1
ii  libgdk-pixbuf2.0-0   2.32.2-1
ii  libglib2.0-0 2.46.2-1
ii  libgnome-desktop-3-123.18.2-1
ii  libgtk-3-0   3.18.5-1
ii  libpango-1.0-0   1.38.1-1
ii  libpangocairo-1.0-0  1.38.1-1
ii  libzapojit-0.0-0 0.0.3-1+b1
ii  tracker  1.6.1-1

Versions of packages gnome-documents recommends:
ii  gnome-user-guide  3.18.1-1
ii  libgsf-bin1.14.34-2
ii  unoconv   0.7-1.1

gnome-documents suggests no packages.

-- no debconf information
Show type PDF in GNOME Books also
Because majority of the books are available in PDF formats
--- a/src/search.js
+++ b/src/search.js
@@ -198,22 +198,17 @@
 
 this.addItem(new SearchType({ id: SearchTypeStock.ALL,
   name: _("All") }));
-if (!Application.application.isBooks) {
-this.addItem(new SearchType({ id: SearchTypeStock.COLLECTIONS,
-  name: _("Collections"),
-  filter: 'fn:starts-with(nao:identifier(?urn), \"gd:collection\")',
-  where: '?urn rdf:type nfo:DataContainer .' }));
-this.addItem(new SearchType({ id: SearchTypeStock.PDF,
-  name: _("PDF Documents"),
-  filter: 'fn:contains(nie:mimeType(?urn), \"application/pdf\")',
-  where: '?urn rdf:type nfo:PaginatedTextDocument .' }));
-} else {
-this.addItem(new SearchType({ id: SearchTypeStock.COLLECTIONS,
-  name: _("Collections"),
-  filter: 'fn:starts-with(nao:identifier(?urn), \"gb:collection\")',
-  where: '?urn rdf:type nfo:DataContainer .' }));
-//FIXME we need to remove all the non-Comics PDFs here
-}
+
+	// gnome-documents has the capability to render PDF docs
+	// I can't see a reason why someone would think that Books cannot be in PDF format..
+this.addItem(new SearchType({ id: SearchTypeStock.COLLECTIONS,
+