diff --git a/app/schemas/ai.elimu.content_provider.room.db.RoomDb/26.json b/app/schemas/ai.elimu.content_provider.room.db.RoomDb/26.json index e4efe9ec..7ad9bace 100644 --- a/app/schemas/ai.elimu.content_provider.room.db.RoomDb/26.json +++ b/app/schemas/ai.elimu.content_provider.room.db.RoomDb/26.json @@ -2,7 +2,7 @@ "formatVersion": 1, "database": { "version": 26, - "identityHash": "59e65b275fee9665d0c18eb2d49f6a3a", + "identityHash": "0f15f0f2b2fa7d5262a10c32eb16e440", "entities": [ { "tableName": "Letter", @@ -414,56 +414,6 @@ "indices": [], "foreignKeys": [] }, - { - "tableName": "Audio", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`title` TEXT NOT NULL, `transcription` TEXT NOT NULL, `audioFormat` TEXT NOT NULL, `revisionNumber` INTEGER NOT NULL, `usageCount` INTEGER, `id` INTEGER, PRIMARY KEY(`id`))", - "fields": [ - { - "fieldPath": "title", - "columnName": "title", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "transcription", - "columnName": "transcription", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "audioFormat", - "columnName": "audioFormat", - "affinity": "TEXT", - "notNull": true - }, - { - "fieldPath": "revisionNumber", - "columnName": "revisionNumber", - "affinity": "INTEGER", - "notNull": true - }, - { - "fieldPath": "usageCount", - "columnName": "usageCount", - "affinity": "INTEGER", - "notNull": false - }, - { - "fieldPath": "id", - "columnName": "id", - "affinity": "INTEGER", - "notNull": false - } - ], - "primaryKey": { - "columnNames": [ - "id" - ], - "autoGenerate": false - }, - "indices": [], - "foreignKeys": [] - }, { "tableName": "StoryBook", "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`title` TEXT NOT NULL, `description` TEXT, `coverImageId` INTEGER NOT NULL, `readingLevel` TEXT, `revisionNumber` INTEGER NOT NULL, `usageCount` INTEGER, `id` INTEGER, PRIMARY KEY(`id`))", @@ -677,7 +627,7 @@ "views": [], "setupQueries": [ "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", - "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '59e65b275fee9665d0c18eb2d49f6a3a')" + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '0f15f0f2b2fa7d5262a10c32eb16e440')" ] } } \ No newline at end of file diff --git a/app/schemas/ai.elimu.content_provider.room.db.RoomDb/27.json b/app/schemas/ai.elimu.content_provider.room.db.RoomDb/27.json new file mode 100644 index 00000000..fee8b76c --- /dev/null +++ b/app/schemas/ai.elimu.content_provider.room.db.RoomDb/27.json @@ -0,0 +1,633 @@ +{ + "formatVersion": 1, + "database": { + "version": 27, + "identityHash": "0f15f0f2b2fa7d5262a10c32eb16e440", + "entities": [ + { + "tableName": "Letter", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`text` TEXT, `diacritic` INTEGER, `revisionNumber` INTEGER NOT NULL, `usageCount` INTEGER, `id` INTEGER, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "text", + "columnName": "text", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "diacritic", + "columnName": "diacritic", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "revisionNumber", + "columnName": "revisionNumber", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "usageCount", + "columnName": "usageCount", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "Sound", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`valueIpa` TEXT, `diacritic` INTEGER, `revisionNumber` INTEGER NOT NULL, `usageCount` INTEGER, `id` INTEGER, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "valueIpa", + "columnName": "valueIpa", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "diacritic", + "columnName": "diacritic", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "revisionNumber", + "columnName": "revisionNumber", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "usageCount", + "columnName": "usageCount", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "LetterSound", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`revisionNumber` INTEGER NOT NULL, `usageCount` INTEGER, `id` INTEGER, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "revisionNumber", + "columnName": "revisionNumber", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "usageCount", + "columnName": "usageCount", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "LetterSound_Letter", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`LetterSound_id` INTEGER NOT NULL, `letters_id` INTEGER NOT NULL, PRIMARY KEY(`LetterSound_id`, `letters_id`))", + "fields": [ + { + "fieldPath": "LetterSound_id", + "columnName": "LetterSound_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "letters_id", + "columnName": "letters_id", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "LetterSound_id", + "letters_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "LetterSound_Sound", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`LetterSound_id` INTEGER NOT NULL, `sounds_id` INTEGER NOT NULL, PRIMARY KEY(`LetterSound_id`, `sounds_id`))", + "fields": [ + { + "fieldPath": "LetterSound_id", + "columnName": "LetterSound_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "sounds_id", + "columnName": "sounds_id", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "LetterSound_id", + "sounds_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "Word", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`text` TEXT NOT NULL, `wordType` TEXT, `revisionNumber` INTEGER NOT NULL, `usageCount` INTEGER, `id` INTEGER, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "text", + "columnName": "text", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "wordType", + "columnName": "wordType", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "revisionNumber", + "columnName": "revisionNumber", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "usageCount", + "columnName": "usageCount", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "Number", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`value` INTEGER NOT NULL, `symbol` TEXT, `revisionNumber` INTEGER NOT NULL, `usageCount` INTEGER, `id` INTEGER, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "value", + "columnName": "value", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "symbol", + "columnName": "symbol", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "revisionNumber", + "columnName": "revisionNumber", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "usageCount", + "columnName": "usageCount", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "Emoji", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`glyph` TEXT NOT NULL, `unicodeVersion` REAL NOT NULL, `unicodeEmojiVersion` REAL NOT NULL, `revisionNumber` INTEGER NOT NULL, `usageCount` INTEGER, `id` INTEGER, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "glyph", + "columnName": "glyph", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "unicodeVersion", + "columnName": "unicodeVersion", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "unicodeEmojiVersion", + "columnName": "unicodeEmojiVersion", + "affinity": "REAL", + "notNull": true + }, + { + "fieldPath": "revisionNumber", + "columnName": "revisionNumber", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "usageCount", + "columnName": "usageCount", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "Emoji_Word", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`Emoji_id` INTEGER NOT NULL, `words_id` INTEGER NOT NULL, PRIMARY KEY(`Emoji_id`, `words_id`))", + "fields": [ + { + "fieldPath": "Emoji_id", + "columnName": "Emoji_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "words_id", + "columnName": "words_id", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "Emoji_id", + "words_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "Image", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`title` TEXT NOT NULL, `imageFormat` TEXT NOT NULL, `revisionNumber` INTEGER NOT NULL, `usageCount` INTEGER, `id` INTEGER, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "title", + "columnName": "title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "imageFormat", + "columnName": "imageFormat", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "revisionNumber", + "columnName": "revisionNumber", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "usageCount", + "columnName": "usageCount", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "Image_Word", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`Image_id` INTEGER NOT NULL, `words_id` INTEGER NOT NULL, PRIMARY KEY(`Image_id`, `words_id`))", + "fields": [ + { + "fieldPath": "Image_id", + "columnName": "Image_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "words_id", + "columnName": "words_id", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "Image_id", + "words_id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "StoryBook", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`title` TEXT NOT NULL, `description` TEXT, `coverImageId` INTEGER NOT NULL, `readingLevel` TEXT, `revisionNumber` INTEGER NOT NULL, `usageCount` INTEGER, `id` INTEGER, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "title", + "columnName": "title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "description", + "columnName": "description", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "coverImageId", + "columnName": "coverImageId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "readingLevel", + "columnName": "readingLevel", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "revisionNumber", + "columnName": "revisionNumber", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "usageCount", + "columnName": "usageCount", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "StoryBookChapter", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`storyBookId` INTEGER NOT NULL, `sortOrder` INTEGER NOT NULL, `imageId` INTEGER NOT NULL, `id` INTEGER, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "storyBookId", + "columnName": "storyBookId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "sortOrder", + "columnName": "sortOrder", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "imageId", + "columnName": "imageId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "StoryBookParagraph", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`storyBookChapterId` INTEGER NOT NULL, `sortOrder` INTEGER NOT NULL, `originalText` TEXT NOT NULL, `id` INTEGER, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "storyBookChapterId", + "columnName": "storyBookChapterId", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "sortOrder", + "columnName": "sortOrder", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "originalText", + "columnName": "originalText", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "StoryBookParagraph_Word", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`StoryBookParagraph_id` INTEGER NOT NULL, `words_id` INTEGER NOT NULL, `words_ORDER` INTEGER NOT NULL, PRIMARY KEY(`StoryBookParagraph_id`, `words_ORDER`))", + "fields": [ + { + "fieldPath": "StoryBookParagraph_id", + "columnName": "StoryBookParagraph_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "words_id", + "columnName": "words_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "words_ORDER", + "columnName": "words_ORDER", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "StoryBookParagraph_id", + "words_ORDER" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "Video", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`title` TEXT NOT NULL, `videoFormat` TEXT NOT NULL, `revisionNumber` INTEGER NOT NULL, `usageCount` INTEGER, `id` INTEGER, PRIMARY KEY(`id`))", + "fields": [ + { + "fieldPath": "title", + "columnName": "title", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "videoFormat", + "columnName": "videoFormat", + "affinity": "TEXT", + "notNull": true + }, + { + "fieldPath": "revisionNumber", + "columnName": "revisionNumber", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "usageCount", + "columnName": "usageCount", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": false + }, + "indices": [], + "foreignKeys": [] + } + ], + "views": [], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '0f15f0f2b2fa7d5262a10c32eb16e440')" + ] + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 21d1c270..7f8b1068 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -59,11 +59,6 @@ android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/image_file_path"/> - pathSegments = uri.getPathSegments(); - Log.i(getClass().getName(), "pathSegments: " + pathSegments); - String audioIdAsString = pathSegments.get(1); - Long audioId = Long.valueOf(audioIdAsString); - Log.i(getClass().getName(), "audioId: " + audioId); - - final Cursor cursor; - - // Get the Room Cursor - cursor = audioDao.loadAsCursor(audioId); - Log.i(getClass().getName(), "cursor: " + cursor); - - cursor.setNotificationUri(context.getContentResolver(), uri); - - return cursor; - } else if (code == CODE_AUDIO_TRANSCRIPTION) { - // Extract the transcription from the URI - List pathSegments = uri.getPathSegments(); - Log.i(getClass().getName(), "pathSegments: " + pathSegments); - String transcription = pathSegments.get(2); - Log.i(getClass().getName(), "transcription: \"" + transcription + "\""); - - final Cursor cursor; - - // Get the Room Cursor - cursor = audioDao.loadByTranscriptionAsCursor(transcription); - Log.i(getClass().getName(), "cursor: " + cursor); - - cursor.setNotificationUri(context.getContentResolver(), uri); - - return cursor; - } else if (code == CODE_AUDIO_TITLE) { - // Extract the transcription from the URI - List pathSegments = uri.getPathSegments(); - Log.i(getClass().getName(), "pathSegments: " + pathSegments); - String title = pathSegments.get(2); - Log.i(getClass().getName(), "title: \"" + title + "\""); - - final Cursor cursor; - - // Get the Room Cursor - cursor = audioDao.loadByTitleAsCursor(title); - Log.i(getClass().getName(), "cursor: " + cursor); - - cursor.setNotificationUri(context.getContentResolver(), uri); - - return cursor; - } else { - throw new IllegalArgumentException("Unknown URI: " + uri); - } - } - - /** - * Handles requests for the MIME type of the data at the given URI. - */ - @Override - public String getType(Uri uri) { - Log.i(getClass().getName(), "getType"); - - throw new UnsupportedOperationException("Not yet implemented"); - } - - /** - * Handles requests to insert a new row. - */ - @Override - public Uri insert(Uri uri, ContentValues values) { - Log.i(getClass().getName(), "insert"); - - throw new UnsupportedOperationException("Not yet implemented"); - } - - /** - * Handles requests to update one or more rows. - */ - @Override - public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { - Log.i(getClass().getName(), "update"); - - throw new UnsupportedOperationException("Not yet implemented"); - } - - /** - * Handle requests to delete one or more rows. - */ - @Override - public int delete(Uri uri, String selection, String[] selectionArgs) { - Log.i(getClass().getName(), "delete"); - - throw new UnsupportedOperationException("Not yet implemented"); - } -} diff --git a/app/src/main/java/ai/elimu/content_provider/rest/AudiosService.java b/app/src/main/java/ai/elimu/content_provider/rest/AudiosService.java deleted file mode 100644 index 53095e42..00000000 --- a/app/src/main/java/ai/elimu/content_provider/rest/AudiosService.java +++ /dev/null @@ -1,13 +0,0 @@ -package ai.elimu.content_provider.rest; - -import java.util.List; - -import ai.elimu.model.v2.gson.content.AudioGson; -import retrofit2.Call; -import retrofit2.http.GET; - -public interface AudiosService { - - @GET("content/audios") - Call> listAudios(); -} diff --git a/app/src/main/java/ai/elimu/content_provider/room/GsonToRoomConverter.java b/app/src/main/java/ai/elimu/content_provider/room/GsonToRoomConverter.java index e63c6889..f5dcff94 100644 --- a/app/src/main/java/ai/elimu/content_provider/room/GsonToRoomConverter.java +++ b/app/src/main/java/ai/elimu/content_provider/room/GsonToRoomConverter.java @@ -2,7 +2,6 @@ import ai.elimu.content_provider.room.entity.LetterSound; import ai.elimu.content_provider.room.entity.Sound; -import ai.elimu.content_provider.room.entity.Audio; import ai.elimu.content_provider.room.entity.Emoji; import ai.elimu.content_provider.room.entity.Image; import ai.elimu.content_provider.room.entity.Letter; @@ -14,7 +13,6 @@ import ai.elimu.content_provider.room.entity.Word; import ai.elimu.model.v2.gson.content.LetterSoundGson; import ai.elimu.model.v2.gson.content.SoundGson; -import ai.elimu.model.v2.gson.content.AudioGson; import ai.elimu.model.v2.gson.content.EmojiGson; import ai.elimu.model.v2.gson.content.ImageGson; import ai.elimu.model.v2.gson.content.LetterGson; @@ -177,28 +175,6 @@ public static Image getImage(ImageGson imageGson) { } } - public static Audio getAudio(AudioGson audioGson) { - if (audioGson == null) { - return null; - } else { - Audio audio = new Audio(); - - // BaseEntity - audio.setId(audioGson.getId()); - - // Content - audio.setRevisionNumber(audioGson.getRevisionNumber()); - audio.setUsageCount(audioGson.getUsageCount()); - - // Audio - audio.setTitle(audioGson.getTitle()); - audio.setTranscription(audioGson.getTranscription()); - audio.setAudioFormat(audioGson.getAudioFormat()); - - return audio; - } - } - public static StoryBook getStoryBook(StoryBookGson storyBookGson) { if (storyBookGson == null) { return null; diff --git a/app/src/main/java/ai/elimu/content_provider/room/dao/AudioDao.java b/app/src/main/java/ai/elimu/content_provider/room/dao/AudioDao.java deleted file mode 100644 index e40b1b37..00000000 --- a/app/src/main/java/ai/elimu/content_provider/room/dao/AudioDao.java +++ /dev/null @@ -1,49 +0,0 @@ -package ai.elimu.content_provider.room.dao; - -import android.database.Cursor; - -import androidx.room.Dao; -import androidx.room.Insert; -import androidx.room.Query; -import androidx.room.Update; - -import java.util.List; - -import ai.elimu.content_provider.room.entity.Audio; - -@Dao -public interface AudioDao { - - @Insert - void insert(Audio audio); - - @Query("SELECT * FROM Audio WHERE id = :id") - Audio load(Long id); - - @Query("SELECT * FROM Audio WHERE id = :id") - Cursor loadAsCursor(Long id); - - @Query("SELECT * FROM Audio WHERE transcription = :transcription") - Audio loadByTranscription(String transcription); - - @Query("SELECT * FROM Audio WHERE transcription = :transcription") - Cursor loadByTranscriptionAsCursor(String transcription); - - @Query("SELECT * FROM Audio WHERE title = :title") - Audio loadByTitle(String title); - - @Query("SELECT * FROM Audio WHERE title = :title") - Cursor loadByTitleAsCursor(String title); - - @Query("SELECT * FROM Audio") - List