Various fixes

master
Evan Leybourn 2010-12-11 16:37:19 +11:00
parent 7064fb1fc6
commit 54ae799843
4 changed files with 41 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.eleybourn.bookcatalogue"
android:versionName="3.1.2" android:versionCode="41">
android:versionName="3.2" android:versionCode="42">
<application android:label="@string/app_name" android:icon="@drawable/logo_bc">
<activity android:name=".BookCatalogue"
android:label="@string/app_name">

2
README
View File

@ -43,7 +43,7 @@ Features include;
New in v3.2
* Books can now be automatically added by searching for the author name and book title
* Updating thumbnails, genre and description fields will also searh by author name and title is the isbn does not exist
* Updating thumbnails, genre and description fields will also search by author name and title is the isbn does not exist
* Expand/Collapse all bug fixed
* The search query will be shown at the top of all search screens

View File

@ -44,6 +44,7 @@ import android.os.Environment;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
@ -489,22 +490,28 @@ public class AdministrationFunctions extends Activity {
}
String dateReadStartString = "";
try {
Log.e("BC", "S" + books.getString(books.getColumnIndexOrThrow(CatalogueDBAdapter.KEY_READ_START)));
String[] date = books.getString(books.getColumnIndexOrThrow(CatalogueDBAdapter.KEY_READ_START)).split("-");
int yyyy = Integer.parseInt(date[0]);
int mm = Integer.parseInt(date[1])+1;
int dd = Integer.parseInt(date[2]);
dateReadStartString = yyyy + "-" + mm + "-" + dd;
Log.e("BC", dateReadStartString);
} catch (Exception e) {
Log.e("BC", "EXPORT ERROR");
//do nothing
}
String dateReadEndString = "";
try {
Log.e("BC", "S" + books.getString(books.getColumnIndexOrThrow(CatalogueDBAdapter.KEY_READ_END)));
String[] date = books.getString(books.getColumnIndexOrThrow(CatalogueDBAdapter.KEY_READ_END)).split("-");
int yyyy = Integer.parseInt(date[0]);
int mm = Integer.parseInt(date[1])+1;
int dd = Integer.parseInt(date[2]);
dateReadEndString = yyyy + "-" + mm + "-" + dd;
Log.e("BC", dateReadEndString);
} catch (Exception e) {
Log.e("BC", "EXPORT ERROR2");
//do nothing
}
String anthology = books.getString(books.getColumnIndexOrThrow(CatalogueDBAdapter.KEY_ANTHOLOGY));
@ -859,7 +866,7 @@ public class AdministrationFunctions extends Activity {
String read_start = "";
try {
read_start = imported[19];
String[] date = date_published.split("-");
String[] date = read_start.split("-");
int yyyy = Integer.parseInt(date[0]);
int mm = Integer.parseInt(date[1])-1;
int dd = Integer.parseInt(date[2]);
@ -871,13 +878,16 @@ public class AdministrationFunctions extends Activity {
String read_end = "";
try {
read_end = imported[20];
String[] date = date_published.split("-");
Log.e("BC", "R" + read_end);
String[] date = read_end.split("-");
int yyyy = Integer.parseInt(date[0]);
int mm = Integer.parseInt(date[1])-1;
int dd = Integer.parseInt(date[2]);
read_end = yyyy + "-" + mm + "-" + dd;
Log.e("BC", "C" + read_end);
} catch (Exception e) {
read_end = "";
Log.e("BC", "ERROR");
}
String format = "";

View File

@ -204,7 +204,7 @@ public class CatalogueDBAdapter {
private final Context mCtx;
public static final int DATABASE_VERSION = 49;
public static final int DATABASE_VERSION = 50;
/**
* This is a specific version of the SQLiteOpenHelper class. It handles onCreate and onUpgrade events
@ -493,7 +493,15 @@ public class CatalogueDBAdapter {
message += "* The 'Add Book by ISBN' page has been redesigned to be simpler and more stable (thanks Vinikia)\n\n";
message += "* The export file is now formatted correctly (.csv) (thanks glohr)\n\n";
message += "* You will be prompted to backup your books on a regular basis \n\n";
try {
db.execSQL("DROP TABLE tmp1");
db.execSQL("DROP TABLE tmp2");
db.execSQL("DROP TABLE tmp3");
} catch (Exception e) {
//do nothing
}
try {
db.execSQL(DATABASE_CREATE_BOOK_BOOKSHELF_WEAK);
db.execSQL(DATABASE_CREATE_INDICES);
@ -545,6 +553,15 @@ public class CatalogueDBAdapter {
if (curVersion == 44) {
//do nothing
curVersion++;
try {
db.execSQL("DROP TABLE tmp1");
db.execSQL("DROP TABLE tmp2");
db.execSQL("DROP TABLE tmp3");
} catch (Exception e) {
//do nothing
}
db.execSQL("CREATE TABLE tmp1 AS SELECT _id, " + KEY_AUTHOR + ", " + KEY_TITLE + ", " + KEY_ISBN + ", " + KEY_PUBLISHER + ", " +
KEY_DATE_PUBLISHED + ", " + KEY_RATING + ", " + KEY_READ + ", " + KEY_SERIES + ", " + KEY_PAGES + ", " + KEY_SERIES_NUM + ", " + KEY_NOTES + ", " +
KEY_LIST_PRICE + ", " + KEY_ANTHOLOGY + ", " + KEY_LOCATION + ", " + KEY_READ_START + ", " + KEY_READ_END + ", " +
@ -629,6 +646,14 @@ public class CatalogueDBAdapter {
db.execSQL("delete from anthology where _id!=(select max(a2._id) from anthology a2 where a2.book=anthology.book AND a2.author=anthology.author AND a2.title=anthology.title);");
db.execSQL(DATABASE_CREATE_INDICES);
}
if (curVersion == 49) {
curVersion++;
message += "New in v3.2\n\n";
message += "* Books can now be automatically added by searching for the author name and book title\n\n";
message += "* Updating thumbnails, genre and description fields will also search by author name and title is the isbn does not exist\n\n";
message += "* Expand/Collapse all bug fixed\n\n";
message += "* The search query will be shown at the top of all search screens\n\n";
}
}
}