Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New standard tags should be interpreted properly #1574

Closed
kelson42 opened this issue Oct 27, 2019 · 11 comments · Fixed by #1630
Closed

New standard tags should be interpreted properly #1574

kelson42 opened this issue Oct 27, 2019 · 11 comments · Fixed by #1630

Comments

@kelson42
Copy link
Collaborator

Like described at https://wiki.openzim.org/wiki/Tags. Would be good to secure some kind of backward compatbility.

See also #1407

@macgills
Copy link
Contributor

macgills commented Dec 2, 2019

@kelson42 I do not understand what is to be done for this ticket.

Will our meta4 links' content contain tags?
Will we need to point the Library at a new endpoint?
Are tags supplied from kiwixlib ie known only for downloaded books?
Tags are to be added to the ui of our list items like pic/vid?
Tags should be searchable?

@kelson42
Copy link
Collaborator Author

kelson42 commented Dec 2, 2019

Will our meta4 links' content contain tags?

No, this is about the catalog.

Will we need to point the Library at a new endpoint?

Yes, but not now.

Are tags supplied from kiwixlib ie known only for downloaded books?

Tags are in the ZIM files and in the catalog (https://download.kiwix.org/library/library_zim.xml).

Tags are to be added to the ui of our list items like pic/vid?

Yes. This is the most important. It is already done, but that does not fit the new rules.

Tags should be searchable?

No. No new feature, just secure the information displayed are proper. Ideally, I would like to see a kind of simple "visual code "to easily identify if content is videos&audios/pictures/text only/shortened text only. The way how it is displayed for the "device" should probably be adopted also for the online library.

Hope this is more clear.

@macgills
Copy link
Contributor

macgills commented Dec 2, 2019

Okay, I have an idea of what to do now.

_ftindex:<no|yes>: indicates wheter the ZIM file includes a full-text index.
_pictures:<no|yes>: indicates whether the ZIM file includes pictures.
_videos:<no|yes>: indicates whether the ZIM file includes videos.
_details:<no|yes>: indicates whether the ZIM file includes detailed content.
_category:<xxx>: indicates that the ZIM file could be categorized as xxx. ZIM readers don't have to follow this convention. Kiwix readers don't even use the _category Tag in readers but uses it to inform its separate filtering mechanism.

the showing of pic/vid should be controlled by _pictures/_video:yes|no
We can add a text only label if both those are 'no', are these tags guaranteed to be present on all zims?
text only becomes short text only if _details:no?

@kelson42
Copy link
Collaborator Author

kelson42 commented Dec 2, 2019

the showing of pic/vid should be controlled by _pictures/_video:yes|no

yes

We can add a text only label if both those are 'no', are these tags guaranteed to be present on all zims?

yes and no maybe the tags are not there... but then there is nothing you say or show. I think the libzim always deliver something...

text only becomes short text only if _details:no?

exactly.

@macgills
Copy link
Contributor

macgills commented Dec 5, 2019

@kelson42 I think this should be deferred until kiwixlib has been updated to provide us with tags.

As it currently stands if the user downloads a zim from outside the app we would have no way of inferring the tags aside from the current solution of parsing the filename.

@kelson42
Copy link
Collaborator Author

kelson42 commented Dec 5, 2019

@macgills The Kiwixlib provides the tags AFAIK. What is exactly missing? Or is the problem that you parse the library_zim.xml in Java?

@macgills
Copy link
Contributor

macgills commented Dec 5, 2019

@kelson42 there is no getTags method in the public api of kiwixlib.

public class JNIKiwixReader {
  private long nativeHandle;

  public native String getMainPage();

  public native String getTitle();

  public native String getId();

  public native String getLanguage();

  public native String getMimeType(String var1);

  public native String checkUrl(String var1);

  public native byte[] getContent(JNIKiwixString var1, JNIKiwixString var2, JNIKiwixString var3, JNIKiwixInt var4);

  public native byte[] getContentPart(String var1, int var2, int var3, JNIKiwixInt var4);

  public native Pair getDirectAccessInformation(String var1);

  public native boolean searchSuggestions(String var1, int var2);

  public native boolean getNextSuggestion(JNIKiwixString var1, JNIKiwixString var2);

  public native boolean getPageUrlFromTitle(String var1, JNIKiwixString var2);

  public native String getDescription();

  public native String getDate();

  public native String getFavicon();

  public native String getCreator();

  public native String getPublisher();

  public native String getName();

  public native int getFileSize();

  public native int getArticleCount();

  public native int getMediaCount();

  public native boolean getRandomPage(JNIKiwixString var1);

  public JNIKiwixSearcher search(String query, int count) {
    JNIKiwixSearcher searcher = new JNIKiwixSearcher();
    searcher.addKiwixReader(this);
    searcher.search(query, count);
    return searcher;
  }

  public JNIKiwixReader(String filename) throws JNIKiwixException {
    this.nativeHandle = this.getNativeReader(filename);
    if (this.nativeHandle == 0L) {
      throw new JNIKiwixException("Cannot open zimfile " + filename);
    }
  }

  public JNIKiwixReader() {
  }

  public native void dispose();

  private native long getNativeReader(String var1);
}

at least not in 8.2.1

@macgills
Copy link
Contributor

@kelson42 I am thinking of using the material Chips component to render the tag information

@kelson42
Copy link
Collaborator Author

@macgills Good, post a mockup if you can.

@macgills
Copy link
Contributor

image

@macgills
Copy link
Contributor

@kelson42 I believe you were talking about all items being present, this would be an example of a no_pic, no_vid, no_details list item:
image

I can make this line of chips wrap to the next line or be horizontally scrollable if we want to add more or change the text up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants