Skip to content

Commit

Permalink
fixed logic to check download in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
jitender.singh committed Jan 8, 2022
1 parent b990bf0 commit 76261da
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/src/main/java/jp/id/LectureAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class LectureAdapter extends RecyclerView.Adapter<LectureAdapter.ViewHold

private final Impartus impartus;
private final Context context;
private int downloadCounter = 0;

private final String tag = "LectureAdapter";

Expand Down Expand Up @@ -149,7 +148,7 @@ public void onBindViewHolder(@NonNull LectureAdapter.ViewHolder holder, @Suppres
menuItem.setEnabled(false);
Lectures.incrementDownloads();

if (downloadCounter > 1) {
if (Lectures.isDownloadInProgress()) {
AppLogs.info(tag, String.format("Download queued for %s", Utils.getMkvFileName(lectureItem)));
Toast.makeText(view.getContext(), "Download Queued!", Toast.LENGTH_SHORT).show();
lectureItem.setDownloadStatus(LectureItem.DownloadStatus.STARTED.ordinal());
Expand Down

0 comments on commit 76261da

Please sign in to comment.