@@ -15,6 +15,7 @@ import androidx.documentfile.provider.DocumentFile
1515import androidx.lifecycle.MutableLiveData
1616import com.philkes.notallyx.R
1717import com.philkes.notallyx.data.NotallyDatabase
18+ import com.philkes.notallyx.data.dao.BaseNoteDao.Companion.MAX_BODY_CHAR_LENGTH
1819import com.philkes.notallyx.data.imports.ImportProgress
1920import com.philkes.notallyx.data.imports.ImportStage
2021import com.philkes.notallyx.data.model.Audio
@@ -121,8 +122,28 @@ suspend fun ContextWrapper.importZip(
121122 SQLiteDatabase .openDatabase(dbFile.path, null , SQLiteDatabase .OPEN_READONLY )
122123
123124 val labelCursor = database.query(" Label" , null , null , null , null , null , null )
124- val baseNoteCursor = database.query(" BaseNote" , null , null , null , null , null , null )
125-
125+ val columns =
126+ arrayOf(
127+ " id" ,
128+ " type" ,
129+ " folder" ,
130+ " color" ,
131+ " title" ,
132+ " pinned" ,
133+ " timestamp" ,
134+ " modifiedTimestamp" ,
135+ " labels" ,
136+ " SUBSTR(body, 1, ${MAX_BODY_CHAR_LENGTH } ) AS body" ,
137+ " spans" ,
138+ " items" ,
139+ " images" ,
140+ " files" ,
141+ " audios" ,
142+ " reminders" ,
143+ " viewMode" ,
144+ )
145+ val baseNoteCursor =
146+ database.query(" BaseNote" , columns, null , null , null , null , null )
126147 val labels = labelCursor.toList { cursor -> cursor.toLabel() }
127148
128149 var total = baseNoteCursor.count
@@ -137,7 +158,6 @@ suspend fun ContextWrapper.importZip(
137158 importingBackup?.postValue(ImportProgress (counter++ , total))
138159 baseNote
139160 }
140-
141161 delay(1000 )
142162
143163 total =
0 commit comments