Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

Commit fe62403

Browse files
committed
Merge branch 'shahidtamboli/MOB-1593-hide-download-progress'
2 parents 3f4568a + 591f1c6 commit fe62403

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: VideoLocker/src/main/java/org/edx/mobile/module/db/IDatabase.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public Integer updateVideoLastPlayedOffset(String videoId, int offset,
171171
public IVideoModel getVideoEntryByVideoId(String videoId, DataCallback<IVideoModel> callback);
172172

173173
/**
174-
* Returns {@link IVideoModel} for given videoUrl.
174+
* Returns {@link IVideoModel} which is downloaded or download is in progress for given videoUrl.
175175
* @param videoUrl
176176
* @param callback
177177
* @return

Diff for: VideoLocker/src/main/java/org/edx/mobile/module/db/impl/IDatabaseImpl.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,9 @@ public IVideoModel getVideoEntryByVideoId(String videoId, final DataCallback<IVi
277277
public IVideoModel getVideoByVideoUrl(String videoUrl,
278278
DataCallback<IVideoModel> callback) {
279279
DbOperationGetVideo op = new DbOperationGetVideo(false,DbStructure.Table.DOWNLOADS, null,
280-
DbStructure.Column.URL + "=? AND "+ DbStructure.Column.USERNAME + "=?" ,
281-
new String[] { videoUrl, username}, null);
280+
DbStructure.Column.URL + "=? AND "+DbStructure.Column.DOWNLOADED + "!=? AND "
281+
+ DbStructure.Column.USERNAME + "=?" ,
282+
new String[] { videoUrl, String.valueOf(DownloadedState.ONLINE.ordinal()), username}, null);
282283
op.setCallback(callback);
283284
return enqueue(op);
284285
}

0 commit comments

Comments
 (0)