File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
app/src/main/java/com/quran/labs/androidquran/worker
feature/audio/src/main/java/com/quran/labs/androidquran/feature/audio/api Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,10 @@ class AudioUpdateWorker(
41
41
val currentVersion = quranSettings.currentAudioRevision
42
42
val updates = audioUpdateService.getUpdates(currentVersion)
43
43
44
- Timber .d(" local version: %d - server version: %d" ,
44
+ if (updates != null && currentVersion != updates.currentRevision) {
45
+ Timber .d(" local version: %d - server version: %d" ,
45
46
currentVersion, updates.currentRevision)
46
- if (currentVersion != updates.currentRevision) {
47
+
47
48
val localFilesToDelete = AudioUpdater .computeUpdates(
48
49
updates.updates, audioUtils.getQariList(context),
49
50
AudioFileCheckerImpl (MD5Calculator , audioPathRoot),
@@ -84,6 +85,8 @@ class AudioUpdateWorker(
84
85
}
85
86
Timber .d(" updating audio to revision: %d" , updates.currentRevision)
86
87
quranSettings.currentAudioRevision = updates.currentRevision
88
+ } else {
89
+ Timber .d(" no audio updates found" )
87
90
}
88
91
}
89
92
Result .success()
Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ import retrofit2.http.Query
5
5
6
6
interface AudioUpdateService {
7
7
@GET(" /data/audio_updates.php" )
8
- suspend fun getUpdates (@Query(" revision" ) revision : Int ): AudioUpdates
8
+ suspend fun getUpdates (@Query(" revision" ) revision : Int ): AudioUpdates ?
9
9
}
You can’t perform that action at this time.
0 commit comments