mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-12 08:58:51 -04:00
Merge branch 'master' into fix-library-report
This commit is contained in:
commit
d99c5826ad
@ -1,15 +1,5 @@
|
|||||||
package org.kiwix.kiwixmobile.utils;
|
package org.kiwix.kiwixmobile.utils;
|
||||||
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Environment;
|
|
||||||
import android.os.StatFs;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.text.DecimalFormat;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class StorageUtils {
|
public class StorageUtils {
|
||||||
|
|
||||||
public static String getFileNameFromUrl(String url) {
|
public static String getFileNameFromUrl(String url) {
|
||||||
|
@ -181,17 +181,24 @@ public class FileSearch {
|
|||||||
// This is not a great solution as we shouldn't need to fully open our ZIM files to get their metadata
|
// This is not a great solution as we shouldn't need to fully open our ZIM files to get their metadata
|
||||||
if (ZimContentProvider.canIterate) {
|
if (ZimContentProvider.canIterate) {
|
||||||
if (ZimContentProvider.setZimFile(filePath) != null) {
|
if (ZimContentProvider.setZimFile(filePath) != null) {
|
||||||
book = new LibraryNetworkEntity.Book();
|
try {
|
||||||
book.title = ZimContentProvider.getZimFileTitle();
|
book = new LibraryNetworkEntity.Book();
|
||||||
book.id = ZimContentProvider.getId();
|
book.title = ZimContentProvider.getZimFileTitle();
|
||||||
book.file = new File(filePath);
|
book.id = ZimContentProvider.getId();
|
||||||
book.size = String.valueOf(ZimContentProvider.getFileSize());
|
book.file = new File(filePath);
|
||||||
book.favicon = ZimContentProvider.getFavicon();
|
book.size = String.valueOf(ZimContentProvider.getFileSize());
|
||||||
book.creator = ZimContentProvider.getCreator();
|
book.favicon = ZimContentProvider.getFavicon();
|
||||||
book.publisher = ZimContentProvider.getPublisher();
|
book.creator = ZimContentProvider.getCreator();
|
||||||
book.date = ZimContentProvider.getDate();
|
book.publisher = ZimContentProvider.getPublisher();
|
||||||
book.description = ZimContentProvider.getDescription();
|
book.date = ZimContentProvider.getDate();
|
||||||
book.language = ZimContentProvider.getLanguage();
|
book.description = ZimContentProvider.getDescription();
|
||||||
|
book.language = ZimContentProvider.getLanguage();
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO 20171215 Consider more elegant approaches.
|
||||||
|
// This is to see if we can catch the exception at all!
|
||||||
|
Log.e("kiwix-filesearch", "Problem parsing a book entry from the library file. ", e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Return content provider to its previous state
|
// Return content provider to its previous state
|
||||||
|
@ -62,7 +62,8 @@
|
|||||||
<org.kiwix.kiwixmobile.settings.CustomSwitchPreference
|
<org.kiwix.kiwixmobile.settings.CustomSwitchPreference
|
||||||
android:defaultValue="true"
|
android:defaultValue="true"
|
||||||
android:key="pref_wifi_only"
|
android:key="pref_wifi_only"
|
||||||
android:title="@string/pref_wifi_only"/>
|
android:title="@string/pref_wifi_only"
|
||||||
|
android:summary="@string/pref_wifi_only"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
|
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
|
Loading…
x
Reference in New Issue
Block a user