CAG v5.7.4版本的 MD5 值为:bc57ead76a7a30559f0708e9d60d749f

以下内容为反编译后的 AudioDataSource.java 源代码,内容仅作参考


package org.godfootsteps.audio.AudioRoom;

import android.text.TextUtils;
import com.blankj.utilcode.util.PreferencesDelegate;
import d.c.a.j.s;
import d.c.a.j.v;
import d.c.b.s1.a;
import d.c.b.s1.c;
import d.c.b.s1.e;
import d.c.b.s1.g;
import d.c.b.s1.m;
import d.c.b.s1.t;
import d.c.b.x1.c0;
import i.c.a.c.l;
import i.j.a.e.t.d;
import i.t.d.b;
import i.z.a.c;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import kotlin.Metadata;
import kotlin.coroutines.intrinsics.CoroutineSingletons;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import n.i.a.p;
import n.i.b.h;
import n.i.b.o;
import n.m.k;
import o.b.e0;
import o.b.u0;
import org.godfootsteps.arch.api.AppClient;
import org.godfootsteps.arch.api.entity.Album;
import org.godfootsteps.arch.api.entity.AlbumImage;
import org.godfootsteps.arch.api.entity.AudioTheme;
import org.godfootsteps.arch.api.entity.Track;
import org.godfootsteps.arch.api.model.AudioAlbum;
import org.godfootsteps.arch.api.model.AudioAlbumModel;
import org.godfootsteps.arch.api.model.AudioModel;
import org.godfootsteps.arch.api.model.AudioUpdateItem;
import org.godfootsteps.arch.api.model.BaseModel;
import org.godfootsteps.arch.api.model.HymnList;
import org.godfootsteps.arch.api.model.ImageUpdate;
import org.godfootsteps.arch.api.model.ImageUpdateItem;
import org.godfootsteps.arch.api.model.TrackUpdate;
import org.godfootsteps.arch.api.util.Request;
import org.godfootsteps.audio.DownloadManager.IDownloadManager;
import org.godfootsteps.audio.DownloadManager.TaskManager;
import org.godfootsteps.audio.SongHelper.AudioMethodUtil;
import org.godfootsteps.audio.SongHelper.AudioSyncKt;
import org.godfootsteps.audio.SongHelper.SongCache;
@Metadata(d1 = {"\u0000Â\u0001\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\f\n\u0002\u0010\b\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u000e\n\u0002\u0010\u000b\n\u0002\b\u0012\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b*\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010!\n\u0002\b\u0011\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u001f\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0018\u0018\u0000 \u0080\u00022\u00020\u0001:\u0002\u0080\u0002B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u008f\u0001\u001a\u00030\u0090\u0001J\b\u0010\u0091\u0001\u001a\u00030\u0090\u0001J\u001b\u0010\u0092\u0001\u001a\u00030\u0090\u00012\u000f\u0010\u0093\u0001\u001a\n\u0012\u0005\u0012\u00030\u0095\u00010\u0094\u0001H\u0002J'\u0010\u0096\u0001\u001a\u00030\u0090\u00012\u0007\u0010\u0097\u0001\u001a\u00020_2\u0007\u0010\u0098\u0001\u001a\u00020J2\t\b\u0002\u0010\u0099\u0001\u001a\u00020JH\u0002J\u001b\u0010\u009a\u0001\u001a\u00030\u0090\u00012\u000f\u0010\u0093\u0001\u001a\n\u0012\u0005\u0012\u00030\u0095\u00010\u0094\u0001H\u0002J5\u0010\u009b\u0001\u001a\u00030\u0090\u00012\u000e\u0010\u009c\u0001\u001a\t\u0012\u0004\u0012\u00020$0\u009d\u00012\u0010\u0010\u009e\u0001\u001a\u000b\u0012\u0004\u0012\u00020_\u0018\u00010\u0094\u00012\u0007\u0010\u009f\u0001\u001a\u00020$H\u0002J\u0011\u0010 \u0001\u001a\u00030\u0090\u00012\u0007\u0010¡\u0001\u001a\u00020$J\b\u0010¢\u0001\u001a\u00030\u0090\u0001J0\u0010¢\u0001\u001a\u00030\u0090\u00012\u001b\u0010£\u0001\u001a\u0016\u0012\u0004\u0012\u00020$\u0018\u00010\u001cj\n\u0012\u0004\u0012\u00020$\u0018\u0001`\u001e2\u0007\u0010¤\u0001\u001a\u00020$H\u0002J\u001e\u0010¥\u0001\u001a\u00030\u0090\u00012\u0007\u0010¦\u0001\u001a\u00020\u001d2\t\b\u0002\u0010§\u0001\u001a\u00020JH\u0002J\u0011\u0010¨\u0001\u001a\u00030\u0090\u00012\u0007\u0010©\u0001\u001a\u00020$J\b\u0010ª\u0001\u001a\u00030\u0090\u0001J\u0011\u0010ª\u0001\u001a\u00030\u0090\u00012\u0007\u0010«\u0001\u001a\u00020$J\u0015\u0010¬\u0001\u001a\u00030\u0090\u00012\t\u0010\u0097\u0001\u001a\u0004\u0018\u00010_H\u0002J\u001f\u0010\u00ad\u0001\u001a\u00030\u0090\u00012\n\u0010®\u0001\u001a\u0005\u0018\u00010¯\u00012\u0007\u0010¤\u0001\u001a\u00020$H\u0002J&\u0010°\u0001\u001a\u00030\u0090\u00012\u0011\u0010±\u0001\u001a\f\u0012\u0005\u0012\u00030²\u0001\u0018\u00010\u0094\u00012\u0007\u0010¡\u0001\u001a\u00020$H\u0002J%\u0010³\u0001\u001a\u00030\u0090\u00012\u0010\u0010´\u0001\u001a\u000b\u0012\u0004\u0012\u00020_\u0018\u00010\u0094\u00012\u0007\u0010¦\u0001\u001a\u00020\u001dH\u0002J'\u0010µ\u0001\u001a\u00030\u0090\u00012\u0012\u0010´\u0001\u001a\r\u0012\u0006\u0012\u0004\u0018\u00010_\u0018\u00010\u0094\u00012\u0007\u0010¡\u0001\u001a\u00020$H\u0002J\u0012\u0010¶\u0001\u001a\u0004\u0018\u00010\u001d2\u0007\u0010¡\u0001\u001a\u00020$J\u0010\u0010·\u0001\u001a\u00020$2\u0007\u0010\u0097\u0001\u001a\u00020_J\u0010\u0010¸\u0001\u001a\u00020$2\u0007\u0010©\u0001\u001a\u00020$J\u0012\u0010¹\u0001\u001a\u0002012\u0007\u0010¦\u0001\u001a\u00020\u001dH\u0002J\u0017\u0010º\u0001\u001a\t\u0012\u0004\u0012\u00020_0\u0094\u00012\u0007\u0010¦\u0001\u001a\u00020\u001dJ\u001e\u0010»\u0001\u001a\u0010\u0012\u000b\u0012\t\u0012\u0004\u0012\u00020_0\u0094\u00010¼\u00012\u0007\u0010¦\u0001\u001a\u00020\u001dJ\u0015\u0010½\u0001\u001a\u0010\u0012\u000b\u0012\t\u0012\u0004\u0012\u00020\u001d0\u0094\u00010¼\u0001J\b\u0010¾\u0001\u001a\u00030¿\u0001J\t\u0010À\u0001\u001a\u00020$H\u0002J$\u0010Á\u0001\u001a\u00020$2\u0007\u0010Â\u0001\u001a\u00020$2\u0007\u0010¡\u0001\u001a\u00020$2\t\b\u0002\u0010Ã\u0001\u001a\u00020$J\u0015\u0010Ä\u0001\u001a\u0010\u0012\u000b\u0012\t\u0012\u0004\u0012\u00020\u001d0\u0094\u00010¼\u0001J\u0015\u0010Å\u0001\u001a\u0010\u0012\u000b\u0012\t\u0012\u0004\u0012\u00020\u001d0\u0094\u00010¼\u0001J\u0015\u0010Æ\u0001\u001a\u0010\u0012\u000b\u0012\t\u0012\u0004\u0012\u00020_0\u0094\u00010¼\u0001J&\u0010Ç\u0001\u001a\u00020$2\u0007\u0010Â\u0001\u001a\u00020$2\u0007\u0010È\u0001\u001a\u00020$2\t\b\u0002\u0010É\u0001\u001a\u00020$H\u0002J\u0012\u0010Ç\u0001\u001a\u00020$2\u0007\u0010¦\u0001\u001a\u00020\u001dH\u0002J\u000e\u0010Ê\u0001\u001a\t\u0012\u0004\u0012\u00020_0\u0094\u0001J\u0015\u0010Ë\u0001\u001a\u0010\u0012\u000b\u0012\t\u0012\u0004\u0012\u00020\u001d0\u0094\u00010¼\u0001J4\u0010Ì\u0001\u001a\u000b\u0012\u0004\u0012\u00020_\u0018\u00010\u0094\u00012\u0017\u0010Í\u0001\u001a\u0012\u0012\u0004\u0012\u00020$0\u001cj\b\u0012\u0004\u0012\u00020$`\u001e2\t\u0010Î\u0001\u001a\u0004\u0018\u00010$J\u001b\u0010Ï\u0001\u001a\u000b\u0012\u0004\u0012\u00020_\u0018\u00010\u0094\u00012\t\u0010Î\u0001\u001a\u0004\u0018\u00010$J\u001b\u0010Ð\u0001\u001a\u000b\u0012\u0004\u0012\u00020_\u0018\u00010\u0094\u00012\t\u0010Î\u0001\u001a\u0004\u0018\u00010$J\u001b\u0010Ñ\u0001\u001a\u000b\u0012\u0004\u0012\u00020_\u0018\u00010\u0094\u00012\t\u0010Î\u0001\u001a\u0004\u0018\u00010$J)\u0010Ò\u0001\u001a\u000b\u0012\u0004\u0012\u00020_\u0018\u00010\u0094\u00012\u0017\u0010Ó\u0001\u001a\u0012\u0012\u0004\u0012\u00020$0\u001cj\b\u0012\u0004\u0012\u00020$`\u001eJ4\u0010Ô\u0001\u001a\u000b\u0012\u0004\u0012\u00020_\u0018\u00010\u0094\u00012\u0017\u0010Í\u0001\u001a\u0012\u0012\u0004\u0012\u00020$0\u001cj\b\u0012\u0004\u0012\u00020$`\u001e2\t\u0010Î\u0001\u001a\u0004\u0018\u00010$J\n\u0010Õ\u0001\u001a\u0005\u0018\u00010¿\u0001J\u0019\u0010Ö\u0001\u001a\u000b\u0012\u0004\u0012\u00020\u001d\u0018\u00010\u0094\u00012\u0007\u0010×\u0001\u001a\u00020$J\u0015\u0010Ø\u0001\u001a\u0010\u0012\u000b\u0012\t\u0012\u0004\u0012\u00020\u001d0\u0094\u00010¼\u0001J\u000f\u0010Ù\u0001\u001a\n\u0012\u0005\u0012\u00030¿\u00010\u0094\u0001J\u0016\u0010Ú\u0001\u001a\u0011\u0012\f\u0012\n\u0012\u0005\u0012\u00030¿\u00010\u0094\u00010¼\u0001J\u0017\u0010Û\u0001\u001a\t\u0012\u0004\u0012\u00020_0¼\u00012\u0007\u0010©\u0001\u001a\u00020$J\u0014\u0010Ü\u0001\u001a\u0004\u0018\u00010_2\t\u0010©\u0001\u001a\u0004\u0018\u00010$J\u0019\u0010Ý\u0001\u001a\u00030\u0090\u00012\u000f\u0010Þ\u0001\u001a\n\u0012\u0005\u0012\u00030ß\u00010\u0094\u0001J\u0018\u0010à\u0001\u001a\u00030\u0090\u00012\u000e\u0010á\u0001\u001a\t\u0012\u0004\u0012\u00020_0\u0094\u0001J\u0012\u0010â\u0001\u001a\u00020J2\u0007\u0010ã\u0001\u001a\u00020$H\u0002J\u0010\u0010ä\u0001\u001a\u00020J2\u0007\u0010©\u0001\u001a\u00020$J\u0013\u0010å\u0001\u001a\u00030\u0090\u00012\t\u0010\u0097\u0001\u001a\u0004\u0018\u00010_J\u0013\u0010æ\u0001\u001a\u00030\u0090\u00012\t\u0010\u0097\u0001\u001a\u0004\u0018\u00010_J\u0014\u0010ç\u0001\u001a\u00030\u0090\u00012\b\u0010è\u0001\u001a\u00030é\u0001H\u0002J\u0011\u0010ê\u0001\u001a\u00030\u0090\u00012\u0007\u0010¦\u0001\u001a\u00020\u001dJ\b\u0010ë\u0001\u001a\u00030\u0090\u0001J\u001a\u0010ì\u0001\u001a\u00030\u0090\u00012\u0007\u0010í\u0001\u001a\u00020$2\u0007\u0010î\u0001\u001a\u00020$J\u0013\u0010ï\u0001\u001a\u00030\u0090\u00012\t\b\u0002\u0010ð\u0001\u001a\u00020JJ\u0019\u0010ñ\u0001\u001a\u00030\u0090\u00012\u000f\u0010ò\u0001\u001a\n\u0012\u0005\u0012\u00030¿\u00010\u0094\u0001J\u0018\u0010ó\u0001\u001a\u00030\u0090\u00012\u000e\u0010ô\u0001\u001a\t\u0012\u0004\u0012\u00020_0\u009d\u0001J\b\u0010õ\u0001\u001a\u00030\u0090\u0001J\u0011\u0010ö\u0001\u001a\u00030\u0090\u00012\u0007\u0010÷\u0001\u001a\u00020$J:\u0010ø\u0001\u001a\u00030\u0090\u00012\u001b\u0010ù\u0001\u001a\u0016\u0012\u0004\u0012\u00020_\u0018\u00010\u001cj\n\u0012\u0004\u0012\u00020_\u0018\u0001`\u001e2\u0011\u0010\u0093\u0001\u001a\f\u0012\u0005\u0012\u00030\u0095\u0001\u0018\u00010\u0094\u0001H\u0002JL\u0010ú\u0001\u001a\u00030\u0090\u00012\u001b\u0010ù\u0001\u001a\u0016\u0012\u0004\u0012\u00020_\u0018\u00010\u001cj\n\u0012\u0004\u0012\u00020_\u0018\u0001`\u001e2\u0011\u0010\u0093\u0001\u001a\f\u0012\u0005\u0012\u00030\u0095\u0001\u0018\u00010\u0094\u00012\u0007\u0010¦\u0001\u001a\u00020\u001d2\u0007\u0010\u0098\u0001\u001a\u00020JH\u0002J\u0018\u0010û\u0001\u001a\u00030\u0090\u00012\u000e\u0010¦\u0001\u001a\t\u0012\u0004\u0012\u00020\u001d0\u0094\u0001J\u001c\u0010ü\u0001\u001a\u00030\u0090\u00012\u0007\u0010©\u0001\u001a\u00020$2\u0007\u0010ý\u0001\u001a\u00020$H\u0002J\u001b\u0010þ\u0001\u001a\u00030\u0090\u00012\u0011\u0010±\u0001\u001a\f\u0012\u0005\u0012\u00030²\u0001\u0018\u00010\u0094\u0001J\u0018\u0010ÿ\u0001\u001a\u00030\u0090\u00012\u000e\u0010á\u0001\u001a\t\u0012\u0004\u0012\u00020_0\u0094\u0001R\u001c\u0010\u0003\u001a\u0004\u0018\u00010\u0004X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0005\u0010\u0006\"\u0004\b\u0007\u0010\bR\u001c\u0010\t\u001a\u0004\u0018\u00010\nX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u000b\u0010\f\"\u0004\b\r\u0010\u000eR\u001c\u0010\u000f\u001a\u0004\u0018\u00010\u0010X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0011\u0010\u0012\"\u0004\b\u0013\u0010\u0014R\u001c\u0010\u0015\u001a\u0004\u0018\u00010\u0016X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0017\u0010\u0018\"\u0004\b\u0019\u0010\u001aR*\u0010\u001b\u001a\u0012\u0012\u0004\u0012\u00020\u001d0\u001cj\b\u0012\u0004\u0012\u00020\u001d`\u001eX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001f\u0010 \"\u0004\b!\u0010\"R+\u0010%\u001a\u00020$2\u0006\u0010#\u001a\u00020$8F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\b*\u0010+\u001a\u0004\b&\u0010'\"\u0004\b(\u0010)R\u001e\u0010,\u001a\u0012\u0012\u0004\u0012\u00020$0\u001cj\b\u0012\u0004\u0012\u00020$`\u001eX\u0082\u0004¢\u0006\u0002\n\u0000R+\u0010-\u001a\u00020$2\u0006\u0010#\u001a\u00020$8F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\b0\u0010+\u001a\u0004\b.\u0010'\"\u0004\b/\u0010)R+\u00102\u001a\u0002012\u0006\u0010#\u001a\u0002018F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\b7\u0010+\u001a\u0004\b3\u00104\"\u0004\b5\u00106R\u001e\u00108\u001a\u0012\u0012\u0004\u0012\u00020\u001d0\u001cj\b\u0012\u0004\u0012\u00020\u001d`\u001eX\u0082\u0004¢\u0006\u0002\n\u0000R*\u00109\u001a\u001e\u0012\u0004\u0012\u00020$\u0012\u0004\u0012\u00020$0:j\u000e\u0012\u0004\u0012\u00020$\u0012\u0004\u0012\u00020$`;X\u0082\u0004¢\u0006\u0002\n\u0000R*\u0010<\u001a\u0012\u0012\u0004\u0012\u00020\u001d0\u001cj\b\u0012\u0004\u0012\u00020\u001d`\u001eX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b=\u0010 \"\u0004\b>\u0010\"R\u001e\u0010?\u001a\u0012\u0012\u0004\u0012\u00020$0\u001cj\b\u0012\u0004\u0012\u00020$`\u001eX\u0082\u0004¢\u0006\u0002\n\u0000R+\u0010@\u001a\u0002012\u0006\u0010#\u001a\u0002018F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\bC\u0010+\u001a\u0004\bA\u00104\"\u0004\bB\u00106R+\u0010D\u001a\u0002012\u0006\u0010#\u001a\u0002018F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\bG\u0010+\u001a\u0004\bE\u00104\"\u0004\bF\u00106R*\u0010H\u001a\u001e\u0012\u0004\u0012\u00020$\u0012\u0004\u0012\u00020$0:j\u000e\u0012\u0004\u0012\u00020$\u0012\u0004\u0012\u00020$`;X\u0082\u0004¢\u0006\u0002\n\u0000R\u001a\u0010I\u001a\u00020JX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bI\u0010K\"\u0004\bL\u0010MR+\u0010N\u001a\u00020$2\u0006\u0010#\u001a\u00020$8F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\bQ\u0010+\u001a\u0004\bO\u0010'\"\u0004\bP\u0010)R+\u0010R\u001a\u00020$2\u0006\u0010#\u001a\u00020$8F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\bU\u0010+\u001a\u0004\bS\u0010'\"\u0004\bT\u0010)R*\u0010V\u001a\u0012\u0012\u0004\u0012\u00020\u001d0\u001cj\b\u0012\u0004\u0012\u00020\u001d`\u001eX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bW\u0010 \"\u0004\bX\u0010\"R\u001a\u0010Y\u001a\u00020$X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bZ\u0010'\"\u0004\b[\u0010)R\u000e\u0010\\\u001a\u00020]X\u0082\u000e¢\u0006\u0002\n\u0000R*\u0010^\u001a\u0012\u0012\u0004\u0012\u00020_0\u001cj\b\u0012\u0004\u0012\u00020_`\u001eX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b`\u0010 \"\u0004\ba\u0010\"R*\u0010b\u001a\u0012\u0012\u0004\u0012\u00020\u001d0\u001cj\b\u0012\u0004\u0012\u00020\u001d`\u001eX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bc\u0010 \"\u0004\bd\u0010\"R+\u0010e\u001a\u00020$2\u0006\u0010#\u001a\u00020$8F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\bh\u0010+\u001a\u0004\bf\u0010'\"\u0004\bg\u0010)R\u001e\u0010i\u001a\u0012\u0012\u0004\u0012\u00020$0\u001cj\b\u0012\u0004\u0012\u00020$`\u001eX\u0082\u0004¢\u0006\u0002\n\u0000R+\u0010j\u001a\u00020$2\u0006\u0010#\u001a\u00020$8F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\bm\u0010+\u001a\u0004\bk\u0010'\"\u0004\bl\u0010)R+\u0010n\u001a\u0002012\u0006\u0010#\u001a\u0002018F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\bq\u0010+\u001a\u0004\bo\u00104\"\u0004\bp\u00106R*\u0010r\u001a\u0012\u0012\u0004\u0012\u00020\u001d0\u001cj\b\u0012\u0004\u0012\u00020\u001d`\u001eX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\bs\u0010 \"\u0004\bt\u0010\"R+\u0010u\u001a\u00020$2\u0006\u0010#\u001a\u00020$8F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\bx\u0010+\u001a\u0004\bv\u0010'\"\u0004\bw\u0010)R+\u0010y\u001a\u00020$2\u0006\u0010#\u001a\u00020$8F@FX\u0086\u008e\u0002¢\u0006\u0012\n\u0004\b|\u0010+\u001a\u0004\bz\u0010'\"\u0004\b{\u0010)R,\u0010}\u001a\u0002012\u0006\u0010#\u001a\u0002018F@FX\u0086\u008e\u0002¢\u0006\u0013\n\u0005\b\u0080\u0001\u0010+\u001a\u0004\b~\u00104\"\u0004\b\u007f\u00106R/\u0010\u0081\u0001\u001a\u00020$2\u0006\u0010#\u001a\u00020$8F@FX\u0086\u008e\u0002¢\u0006\u0015\n\u0005\b\u0084\u0001\u0010+\u001a\u0005\b\u0082\u0001\u0010'\"\u0005\b\u0083\u0001\u0010)R/\u0010\u0085\u0001\u001a\u00020$2\u0006\u0010#\u001a\u00020$8F@FX\u0086\u008e\u0002¢\u0006\u0015\n\u0005\b\u0088\u0001\u0010+\u001a\u0005\b\u0086\u0001\u0010'\"\u0005\b\u0087\u0001\u0010)R\"\u0010\u0089\u0001\u001a\u0005\u0018\u00010\u008a\u0001X\u0086\u000e¢\u0006\u0012\n\u0000\u001a\u0006\b\u008b\u0001\u0010\u008c\u0001\"\u0006\b\u008d\u0001\u0010\u008e\u0001¨\u0006\u0081\u0002"}, d2 = {"Lorg/godfootsteps/audio/AudioRoom/AudioDataSource;", "", "()V", "albumDao", "Lorg/godfootsteps/audio/AudioRoom/AlbumDao;", "getAlbumDao", "()Lorg/godfootsteps/audio/AudioRoom/AlbumDao;", "setAlbumDao", "(Lorg/godfootsteps/audio/AudioRoom/AlbumDao;)V", "albumImageDao", "Lorg/godfootsteps/audio/AudioRoom/AlbumImageDao;", "getAlbumImageDao", "()Lorg/godfootsteps/audio/AudioRoom/AlbumImageDao;", "setAlbumImageDao", "(Lorg/godfootsteps/audio/AudioRoom/AlbumImageDao;)V", "audioPlaylistDao", "Lorg/godfootsteps/audio/AudioRoom/AudioPlaylistDao;", "getAudioPlaylistDao", "()Lorg/godfootsteps/audio/AudioRoom/AudioPlaylistDao;", "setAudioPlaylistDao", "(Lorg/godfootsteps/audio/AudioRoom/AudioPlaylistDao;)V", "audioThemeDao", "Lorg/godfootsteps/audio/AudioRoom/AudioThemeDao;", "getAudioThemeDao", "()Lorg/godfootsteps/audio/AudioRoom/AudioThemeDao;", "setAudioThemeDao", "(Lorg/godfootsteps/audio/AudioRoom/AudioThemeDao;)V", "dailyGodWordAlbums", "Ljava/util/ArrayList;", "Lorg/godfootsteps/arch/api/entity/Album;", "Lkotlin/collections/ArrayList;", "getDailyGodWordAlbums", "()Ljava/util/ArrayList;", "setDailyGodWordAlbums", "(Ljava/util/ArrayList;)V", "<set-?>", "", "dailyGodWordHighUrl", "getDailyGodWordHighUrl", "()Ljava/lang/String;", "setDailyGodWordHighUrl", "(Ljava/lang/String;)V", "dailyGodWordHighUrl$delegate", "Lcom/blankj/utilcode/util/PreferencesDelegate;", "dailyGodWordImageUpdate", "dailyGodWordLowUrl", "getDailyGodWordLowUrl", "setDailyGodWordLowUrl", "dailyGodWordLowUrl$delegate", "", "dailyGodWordVersion", "getDailyGodWordVersion", "()I", "setDailyGodWordVersion", "(I)V", "dailyGodWordVersion$delegate", "deleteAlbumImageArray", "hymnAlbumName", "Ljava/util/HashMap;", "Lkotlin/collections/HashMap;", "hymnAlbums", "getHymnAlbums", "setHymnAlbums", "hymnImageUpdate", "hymnListVersion", "getHymnListVersion", "setHymnListVersion", "hymnListVersion$delegate", "hymnsVersion", "getHymnsVersion", "setHymnsVersion", "hymnsVersion$delegate", "idPicMap", "isHaveData", "", "()Z", "setHaveData", "(Z)V", "jlsgHighUrl", "getJlsgHighUrl", "setJlsgHighUrl", "jlsgHighUrl$delegate", "jlsgLowUrl", "getJlsgLowUrl", "setJlsgLowUrl", "jlsgLowUrl$delegate", "kingdomAlbums", "getKingdomAlbums", "setKingdomAlbums", "lan", "getLan", "setLan", "lastRequestTime", "", "newTrackList", "Lorg/godfootsteps/arch/api/entity/Track;", "getNewTrackList", "setNewTrackList", "readingAlbums", "getReadingAlbums", "setReadingAlbums", "readingHighUrl", "getReadingHighUrl", "setReadingHighUrl", "readingHighUrl$delegate", "readingImageUpdate", "readingLowUrl", "getReadingLowUrl", "setReadingLowUrl", "readingLowUrl$delegate", "readingVersion", "getReadingVersion", "setReadingVersion", "readingVersion$delegate", "sermonAlbums", "getSermonAlbums", "setSermonAlbums", "sermonHighUrl", "getSermonHighUrl", "setSermonHighUrl", "sermonHighUrl$delegate", "sermonLowUrl", "getSermonLowUrl", "setSermonLowUrl", "sermonLowUrl$delegate", "sermonVersion", "getSermonVersion", "setSermonVersion", "sermonVersion$delegate", "shxgHighUrl", "getShxgHighUrl", "setShxgHighUrl", "shxgHighUrl$delegate", "shxgLowUrl", "getShxgLowUrl", "setShxgLowUrl", "shxgLowUrl$delegate", "trackDao", "Lorg/godfootsteps/audio/AudioRoom/TrackDao;", "getTrackDao", "()Lorg/godfootsteps/audio/AudioRoom/TrackDao;", "setTrackDao", "(Lorg/godfootsteps/audio/AudioRoom/TrackDao;)V", "clearAlbumImageArray", "", "clearPlaylist", "dealHymnUpdate", "updateList", "", "Lorg/godfootsteps/arch/api/model/TrackUpdate;", "dealTrackOffShelf", "track", "isHymn", "fromService", "dealTrackUpdate", "dealTrackUpdateTo5", "onlineRowId", "", "localList", "albumRowId", "deleteAlbum", "albumId", "deleteAlbumCover", "names", "type", "deleteAlbumImage", "album", "deleteAll", "deleteAlbumRenewMark", "rowId", "deleteThemeRenewMark", "themeId", "deleteTrackCache", "fillAlbumData", "audioAlbum", "Lorg/godfootsteps/arch/api/model/AudioAlbum;", "fillAlbumImageList", "albumImageList", "Lorg/godfootsteps/arch/api/entity/AlbumImage;", "fillAlbumTrack", "trackData", "fillTrack", "getAlbum", "getAlbumDetailTitle", "getAlbumTitle", "getAlbumTrackCount", "getAlbumTrackList", "getAlbumTrackLiveData", "Landroidx/lifecycle/LiveData;", "getDailyGowWordAlbumLiveData", "getDefaultTheme", "Lorg/godfootsteps/arch/api/entity/AudioTheme;", "getDeviceType", "getFxUrl", "category", "trackLan", "getHymnAlbumLiveData", "getKingdomAlbumLiveData", "getNewTrackListLiveData", "getPicNameUrl", "picName", "picLan", "getPlayListTrack", "getReadingAlbumLiveData", "getSearchHymnByRowId", "rowIds", "key", "getSearchOnlineDailyGodWord", "getSearchOnlineHymns", "getSearchOnlineReading", "getSearchOnlineTrackByIds", "ids", "getSearchTrackByRowId", "getSelectTheme", "getSermon", "searchKey", "getSermonAlbumLiveData", "getThemeList", "getThemeLiveData", "getTrack", "getTrackByRowId", "insertPlaylist", "playlists", "Lorg/godfootsteps/arch/api/entity/AudioPlaylist;", "insertTrackList", "trackList", "isContainsNum", "input", "isExistTrack", "markTrackNoLocalPath", "markTrackOffShelf", "parseTrackData", "audioModel", "Lorg/godfootsteps/arch/api/model/AudioModel;", "refreshAlbumServerData", "refreshAudioThemeServer", "refreshSearchResult", "audioType", "keyWord", "refreshServerData", "force", "resetAllTheme", "themeList", "savePlaylistTrackId", "tracks", "setDefaultTheme", "setSelectThemeToDB", "selectId", "syncHymnTrackToDB", "upsertList", "syncTrackToDB", "updateAlbumNeedUpdate", "updateAlbumVersion", "version", "upsertAlbumImage", "upsertTrackList", "Companion", "audio_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
public final class AudioDataSource {
    public static AudioDataSource L;
    public boolean A;
    public d.c.b.s1.a B;
    public c C;
    public t D;
    public e E;
    public g F;
    public String G;
    public long H;
    public final ArrayList<Album> I;
    public final PreferencesDelegate a = new PreferencesDelegate(h.j("hymnsVersion", s.a()), -1, "Audio");
    public final PreferencesDelegate b = new PreferencesDelegate(h.j("hymnListVersion", s.a()), -1, "Audio");
    public final PreferencesDelegate c = new PreferencesDelegate(h.j("readingVersion", s.a()), -1, "Audio");
    public final PreferencesDelegate f15483d = new PreferencesDelegate(h.j("dailyGodWordVersion", s.a()), -1, "Audio");
    public final PreferencesDelegate f15484e = new PreferencesDelegate(h.j("sermonVersion", s.a()), -1, "Audio");
    public final PreferencesDelegate f15485f = new PreferencesDelegate(h.j("shxgLowUrl", s.a()), "", "Audio");
    public final PreferencesDelegate f15486g = new PreferencesDelegate(h.j("shxgHighUrl", s.a()), "", "Audio");
    public final PreferencesDelegate f15487h = new PreferencesDelegate(h.j("jlsgLowUrl", s.a()), "", "Audio");
    public final PreferencesDelegate f15488i = new PreferencesDelegate(h.j("jlsgHighUrl", s.a()), "", "Audio");
    public final PreferencesDelegate f15489j = new PreferencesDelegate(h.j("readingLowUrl", s.a()), "", "Audio");
    public final PreferencesDelegate f15490k = new PreferencesDelegate(h.j("readingHighUrl", s.a()), "", "Audio");
    public final PreferencesDelegate f15491l = new PreferencesDelegate(h.j("sermonLowUrl", s.a()), "", "Audio");
    public final PreferencesDelegate f15492m = new PreferencesDelegate(h.j("sermonHighUrl", s.a()), "", "Audio");
    public final PreferencesDelegate f15493n = new PreferencesDelegate(h.j("dailyGodWordLowUrl", s.a()), "", "Audio");
    public final PreferencesDelegate f15494o = new PreferencesDelegate(h.j("dailyGodWordHighUrl", s.a()), "", "Audio");
    public final ArrayList<String> f15495p = new ArrayList<>();
    public final ArrayList<String> f15496q = new ArrayList<>();
    public final ArrayList<String> f15497r = new ArrayList<>();
    public final HashMap<String, String> f15498s = new HashMap<>();
    public final HashMap<String, String> f15499t = new HashMap<>();
    public ArrayList<Track> f15500u;
    public ArrayList<Album> f15501v;
    public ArrayList<Album> f15502w;
    public ArrayList<Album> x;
    public ArrayList<Album> y;
    public ArrayList<Album> z;
    public static final k<Object>[] K = {i.a.b.a.a.U(AudioDataSource.class, "hymnsVersion", "getHymnsVersion()I", 0), i.a.b.a.a.U(AudioDataSource.class, "hymnListVersion", "getHymnListVersion()I", 0), i.a.b.a.a.U(AudioDataSource.class, "readingVersion", "getReadingVersion()I", 0), i.a.b.a.a.U(AudioDataSource.class, "dailyGodWordVersion", "getDailyGodWordVersion()I", 0), i.a.b.a.a.U(AudioDataSource.class, "sermonVersion", "getSermonVersion()I", 0), i.a.b.a.a.U(AudioDataSource.class, "shxgLowUrl", "getShxgLowUrl()Ljava/lang/String;", 0), i.a.b.a.a.U(AudioDataSource.class, "shxgHighUrl", "getShxgHighUrl()Ljava/lang/String;", 0), i.a.b.a.a.U(AudioDataSource.class, "jlsgLowUrl", "getJlsgLowUrl()Ljava/lang/String;", 0), i.a.b.a.a.U(AudioDataSource.class, "jlsgHighUrl", "getJlsgHighUrl()Ljava/lang/String;", 0), i.a.b.a.a.U(AudioDataSource.class, "readingLowUrl", "getReadingLowUrl()Ljava/lang/String;", 0), i.a.b.a.a.U(AudioDataSource.class, "readingHighUrl", "getReadingHighUrl()Ljava/lang/String;", 0), i.a.b.a.a.U(AudioDataSource.class, "sermonLowUrl", "getSermonLowUrl()Ljava/lang/String;", 0), i.a.b.a.a.U(AudioDataSource.class, "sermonHighUrl", "getSermonHighUrl()Ljava/lang/String;", 0), i.a.b.a.a.U(AudioDataSource.class, "dailyGodWordLowUrl", "getDailyGodWordLowUrl()Ljava/lang/String;", 0), i.a.b.a.a.U(AudioDataSource.class, "dailyGodWordHighUrl", "getDailyGodWordHighUrl()Ljava/lang/String;", 0)};
    public static final a J = new a(null);

    @Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0011\u0010\u0003\u001a\u00020\u00048F¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006R\u0010\u0010\u0007\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\b"}, d2 = {"Lorg/godfootsteps/audio/AudioRoom/AudioDataSource$Companion;", "", "()V", "getInstance", "Lorg/godfootsteps/audio/AudioRoom/AudioDataSource;", "getGetInstance", "()Lorg/godfootsteps/audio/AudioRoom/AudioDataSource;", "instance", "audio_release"}, k = 1, mv = {1, 5, 1}, xi = 48)
    public static final class a {
        public a(n.i.b.e eVar) {
        }

        public final AudioDataSource a() {
            if (AudioDataSource.L == null) {
                AudioDataSource.L = new AudioDataSource();
            }
            AudioDataSource audioDataSource = AudioDataSource.L;
            Objects.requireNonNull(audioDataSource, "null cannot be cast to non-null type org.godfootsteps.audio.AudioRoom.AudioDataSource");
            return audioDataSource;
        }
    }

    public AudioDataSource() {
        this.f15500u = new ArrayList<>();
        this.f15501v = new ArrayList<>();
        this.f15502w = new ArrayList<>();
        this.x = new ArrayList<>();
        this.y = new ArrayList<>();
        this.z = new ArrayList<>();
        this.G = "";
        AudioDataBase b = AudioDataBase.f15473n.b();
        this.B = b.q();
        this.C = b.r();
        this.D = b.z();
        this.E = b.s();
        this.F = b.t();
        String a2 = s.a();
        h.d(a2, "getApiLang()");
        this.G = a2;
        t tVar = this.D;
        List<Track> c = tVar == null ? null : tVar.c(a2);
        h.c(c);
        this.f15500u = (ArrayList) c;
        d.c.b.s1.a aVar = this.B;
        List<Album> h2 = aVar == null ? null : aVar.h(this.G);
        h.c(h2);
        this.f15501v = (ArrayList) h2;
        d.c.b.s1.a aVar2 = this.B;
        List<Album> i2 = aVar2 == null ? null : aVar2.i(this.G);
        h.c(i2);
        this.f15502w = (ArrayList) i2;
        d.c.b.s1.a aVar3 = this.B;
        List<Album> t2 = aVar3 == null ? null : aVar3.t(this.G);
        h.c(t2);
        this.z = (ArrayList) t2;
        d.c.b.s1.a aVar4 = this.B;
        List<Album> g2 = aVar4 == null ? null : aVar4.g(this.G);
        h.c(g2);
        this.x = (ArrayList) g2;
        d.c.b.s1.a aVar5 = this.B;
        List<Album> k2 = aVar5 != null ? aVar5.k(this.G) : null;
        h.c(k2);
        this.y = (ArrayList) k2;
        ArrayList<Track> arrayList = this.f15500u;
        this.A = !(arrayList == null || arrayList.isEmpty());
        this.H = -1L;
        this.I = new ArrayList<>();
    }

    public static final void a(AudioDataSource audioDataSource, ArrayList arrayList, String str) {
        Objects.requireNonNull(audioDataSource);
        if (arrayList == null || arrayList.size() <= 0) {
            return;
        }
        Iterator it = arrayList.iterator();
        while (it.hasNext()) {
            String str2 = (String) it.next();
            if (c0.a == null) {
                c0.a = new c0();
            }
            c0 c0Var = c0.a;
            Objects.requireNonNull(c0Var, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.SongDownloadHelper");
            c0Var.b(str2).delete();
            n.m.t.a.p.m.e1.a.e0(audioDataSource.n(str, str2, audioDataSource.G));
        }
    }

    public static final void b(AudioDataSource audioDataSource, AudioAlbum audioAlbum, String str) {
        List<AudioUpdateItem> update;
        ArrayList<Album> list;
        String sb;
        Objects.requireNonNull(audioDataSource);
        if (audioAlbum == null) {
            d.d.a.c.b().g(new d.c.b.w1.a(2));
            return;
        }
        ArrayList arrayList = new ArrayList();
        ArrayList<Album> list2 = audioAlbum.getList();
        boolean z = true;
        if (!(list2 == null || list2.isEmpty()) && (list = audioAlbum.getList()) != null) {
            for (Album album : list) {
                if (album != null) {
                    List<AlbumImage> image = album.getImage();
                    String id = album.getId();
                    if (!(image == null || image.isEmpty()) && !TextUtils.isEmpty(id)) {
                        for (AlbumImage albumImage : image) {
                            StringBuilder J2 = i.a.b.a.a.J(id);
                            J2.append(albumImage.getType());
                            J2.append(audioDataSource.G);
                            albumImage.setRowId(J2.toString());
                            albumImage.setId(id);
                            albumImage.setLan(audioDataSource.G);
                        }
                        audioDataSource.f15498s.put(id, image.get(0).getPicName());
                        if (!image.isEmpty()) {
                            n.m.t.a.p.m.e1.a.o(n.m.t.a.p.m.e1.a.c(e0.b), null, null, new AudioDataSource$upsertAlbumImage$1(image, audioDataSource, null), 3, null);
                        }
                    }
                    if (!TextUtils.equals(audioDataSource.k(h.j(album.getId(), audioDataSource.G)), album.getTitle())) {
                        n.m.t.a.p.m.e1.a.o(n.m.t.a.p.m.e1.a.c(e0.b), null, null, new AudioDataSource$fillAlbumData$1$1(audioDataSource, album, null), 3, null);
                    }
                    if (h.a(str, "hymns")) {
                        audioDataSource.f15499t.put(h.j(album.getId(), audioDataSource.G), album.getTitle());
                    }
                    album.setRowId(h.j(album.getId(), audioDataSource.G));
                    album.setCategory(str);
                    String category = album.getCategory();
                    int hashCode = category.hashCode();
                    if (hashCode == -1285060275) {
                        if (category.equals("dailyGodWord")) {
                            StringBuilder sb2 = new StringBuilder();
                            Objects.requireNonNull(AppClient.a);
                            sb2.append("https://appservercn.kingdomsalvation.org");
                            if (d.c.b.z1.a.a == null) {
                                d.c.b.z1.a.a = new d.c.b.z1.a();
                            }
                            d.c.b.z1.a aVar = d.c.b.z1.a.a;
                            Objects.requireNonNull(aVar, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
                            sb2.append(aVar.c(audioDataSource.G));
                            sb2.append("md");
                            sb2.append('/');
                            sb2.append((Object) audioDataSource.f15498s.get(album.getId()));
                            sb = sb2.toString();
                            album.setImageUrl(sb);
                            album.setLan(audioDataSource.G);
                        }
                        StringBuilder sb3 = new StringBuilder();
                        Objects.requireNonNull(AppClient.a);
                        sb3.append("https://appservercn.kingdomsalvation.org");
                        if (d.c.b.z1.a.a == null) {
                        }
                        d.c.b.z1.a aVar2 = d.c.b.z1.a.a;
                        Objects.requireNonNull(aVar2, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
                        sb3.append(aVar2.e(audioDataSource.G));
                        sb3.append("md");
                        sb3.append('/');
                        sb3.append((Object) audioDataSource.f15498s.get(album.getId()));
                        sb = sb3.toString();
                        album.setImageUrl(sb);
                        album.setLan(audioDataSource.G);
                    } else if (hashCode == -905834836) {
                        if (category.equals("sermon")) {
                            sb = "";
                            album.setImageUrl(sb);
                            album.setLan(audioDataSource.G);
                        }
                        StringBuilder sb32 = new StringBuilder();
                        Objects.requireNonNull(AppClient.a);
                        sb32.append("https://appservercn.kingdomsalvation.org");
                        if (d.c.b.z1.a.a == null) {
                        }
                        d.c.b.z1.a aVar22 = d.c.b.z1.a.a;
                        Objects.requireNonNull(aVar22, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
                        sb32.append(aVar22.e(audioDataSource.G));
                        sb32.append("md");
                        sb32.append('/');
                        sb32.append((Object) audioDataSource.f15498s.get(album.getId()));
                        sb = sb32.toString();
                        album.setImageUrl(sb);
                        album.setLan(audioDataSource.G);
                    } else {
                        if (hashCode == 1080413836 && category.equals("reading")) {
                            StringBuilder sb4 = new StringBuilder();
                            Objects.requireNonNull(AppClient.a);
                            sb4.append("https://appservercn.kingdomsalvation.org");
                            if (d.c.b.z1.a.a == null) {
                                d.c.b.z1.a.a = new d.c.b.z1.a();
                            }
                            d.c.b.z1.a aVar3 = d.c.b.z1.a.a;
                            Objects.requireNonNull(aVar3, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
                            sb4.append(aVar3.d(audioDataSource.G));
                            sb4.append("md");
                            sb4.append('/');
                            sb4.append((Object) audioDataSource.f15498s.get(album.getId()));
                            sb = sb4.toString();
                            album.setImageUrl(sb);
                            album.setLan(audioDataSource.G);
                        }
                        StringBuilder sb322 = new StringBuilder();
                        Objects.requireNonNull(AppClient.a);
                        sb322.append("https://appservercn.kingdomsalvation.org");
                        if (d.c.b.z1.a.a == null) {
                            d.c.b.z1.a.a = new d.c.b.z1.a();
                        }
                        d.c.b.z1.a aVar222 = d.c.b.z1.a.a;
                        Objects.requireNonNull(aVar222, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
                        sb322.append(aVar222.e(audioDataSource.G));
                        sb322.append("md");
                        sb322.append('/');
                        sb322.append((Object) audioDataSource.f15498s.get(album.getId()));
                        sb = sb322.toString();
                        album.setImageUrl(sb);
                        album.setLan(audioDataSource.G);
                    }
                }
            }
        }
        List<AudioUpdateItem> update2 = audioAlbum.getUpdate();
        if (update2 != null && !update2.isEmpty()) {
            z = false;
        }
        if (!z && (update = audioAlbum.getUpdate()) != null) {
            for (AudioUpdateItem audioUpdateItem : update) {
                Album album2 = new Album(null, null, null, null, 0, null, null, null, 0, 0, 0, null, null, 0, null, null, null, 131071, null);
                album2.setRowId(h.j(audioUpdateItem == null ? null : audioUpdateItem.getId(), audioDataSource.G));
                album2.setId(String.valueOf(audioUpdateItem == null ? null : audioUpdateItem.getId()));
                album2.setUpdateType(String.valueOf(audioUpdateItem == null ? null : audioUpdateItem.getUpdateType()));
                ArrayList<Album> list3 = audioAlbum.getList();
                if (list3 != null) {
                    for (Album album3 : list3) {
                        if (TextUtils.equals(album3 == null ? null : album3.getId(), audioUpdateItem == null ? null : audioUpdateItem.getId())) {
                            album2.setTitle(String.valueOf(album3 == null ? null : album3.getTitle()));
                            album2.setDetailTitle(String.valueOf(album3 == null ? null : album3.getDetailTitle()));
                        }
                    }
                }
                arrayList.add(album2);
            }
        }
        n.m.t.a.p.m.e1.a.o(n.m.t.a.p.m.e1.a.c(e0.b), null, null, new AudioDataSource$fillAlbumData$3(audioAlbum, audioDataSource, arrayList, null), 3, null);
    }

    public final void c() {
        e eVar = this.E;
        if (eVar == null) {
            return;
        }
        eVar.a(this.G);
    }

    public final void d(Track track, boolean z, boolean z2) {
        t tVar;
        t tVar2;
        h(track);
        if (TaskManager.f15525f == null) {
            TaskManager.f15525f = new TaskManager();
        }
        TaskManager taskManager = TaskManager.f15525f;
        Objects.requireNonNull(taskManager, "null cannot be cast to non-null type org.godfootsteps.audio.DownloadManager.TaskManager");
        taskManager.c(track.getRowId());
        if (track.getDownloaded() == 3 && ((track.getRenewMark() == 0 || !z2) && (tVar2 = this.D) != null)) {
            tVar2.J(track.getRowId(), 2);
        }
        if (m.f6353j == null) {
            m.f6353j = new m();
        }
        m mVar = m.f6353j;
        Objects.requireNonNull(mVar, "null cannot be cast to non-null type org.godfootsteps.audio.AudioRoom.MineDataSource");
        mVar.e(d.r3(track), false);
        if (!z) {
            l.f(c.b.a.e(track));
        }
        if (track.getRenewMark() != 1 && (tVar = this.D) != null) {
            tVar.u(track.getRowId());
        }
        Track i2 = b.a.i(track.getRowId());
        if (i2 == null) {
            return;
        }
        i2.setDeleteMark(1);
    }

    public final void e(List<String> list, List<Track> list2, String str) {
        t tVar;
        if (!(list2 == null || list2.isEmpty())) {
            for (Track track : list2) {
                if (list.remove(track.getRowId())) {
                    if (track.getDeleteMark() == 1 && (tVar = this.D) != null) {
                        tVar.f(0, 3, track.getRowId());
                    }
                } else if (track.getDeleteMark() == 0) {
                    if (IDownloadManager.f15524d == null) {
                        IDownloadManager.f15524d = new IDownloadManager();
                    }
                    IDownloadManager iDownloadManager = IDownloadManager.f15524d;
                    Objects.requireNonNull(iDownloadManager, "null cannot be cast to non-null type org.godfootsteps.audio.DownloadManager.IDownloadManager");
                    h.e(track, "it");
                    if (track.getDownloaded() > 1) {
                        if (c0.a == null) {
                            c0.a = new c0();
                        }
                        c0 c0Var = c0.a;
                        Objects.requireNonNull(c0Var, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.SongDownloadHelper");
                        l.g(c0Var.d(track));
                        if (c0.a == null) {
                            c0.a = new c0();
                        }
                        c0 c0Var2 = c0.a;
                        Objects.requireNonNull(c0Var2, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.SongDownloadHelper");
                        l.g(c0Var2.e(track));
                        if (AudioMethodUtil.f15534e == null) {
                            AudioMethodUtil.f15534e = new AudioMethodUtil();
                        }
                        AudioMethodUtil audioMethodUtil = AudioMethodUtil.f15534e;
                        Objects.requireNonNull(audioMethodUtil, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.AudioMethodUtil");
                        if (audioMethodUtil.j(track)) {
                            i.z.a.c cVar = c.b.a;
                            l.f(cVar.g(track));
                            l.f(cVar.f(track));
                        }
                    }
                    if (m.f6353j == null) {
                        m.f6353j = new m();
                    }
                    m mVar = m.f6353j;
                    Objects.requireNonNull(mVar, "null cannot be cast to non-null type org.godfootsteps.audio.AudioRoom.MineDataSource");
                    mVar.o(track);
                    t tVar2 = iDownloadManager.b;
                    if (tVar2 != null) {
                        tVar2.a(track.getRowId());
                    }
                }
            }
        }
        d.c.b.s1.a aVar = this.B;
        if (aVar == null) {
            return;
        }
        aVar.B(str);
    }

    public final void f(String str) {
        h.e(str, "albumId");
        d.c.b.s1.a aVar = this.B;
        Album c = aVar == null ? null : aVar.c(str, this.G);
        if (c == null) {
            return;
        }
        t tVar = this.D;
        if ((tVar == null ? 0 : tVar.j(c.getId(), this.G)) <= 0 && c.getDeleteMark() == 1) {
            g(c, true);
            d.c.b.s1.c cVar = this.C;
            if (cVar != null) {
                cVar.a(c.getRowId());
            }
            d.c.b.s1.a aVar2 = this.B;
            if (aVar2 == null) {
                return;
            }
            aVar2.A(c);
        }
    }

    public final void g(Album album, boolean z) {
        d.c.b.s1.c cVar = this.C;
        List<AlbumImage> e2 = cVar == null ? null : cVar.e(album.getId(), album.getLan());
        if (e2 == null || e2.isEmpty()) {
            return;
        }
        for (AlbumImage albumImage : e2) {
            n.m.t.a.p.m.e1.a.e0(n(album.getCategory(), albumImage.getPicName(), this.G));
            if (z) {
                if (c0.a == null) {
                    c0.a = new c0();
                }
                c0 c0Var = c0.a;
                Objects.requireNonNull(c0Var, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.SongDownloadHelper");
                c0Var.b(albumImage.getPicName()).delete();
            }
        }
    }

    public final void h(Track track) {
        if (track == null) {
            return;
        }
        if (SongCache.b == null) {
            SongCache.b = new SongCache();
        }
        SongCache songCache = SongCache.b;
        Objects.requireNonNull(songCache, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.SongCache");
        if (d.c.b.z1.a.a == null) {
            d.c.b.z1.a.a = new d.c.b.z1.a();
        }
        d.c.b.z1.a aVar = d.c.b.z1.a.a;
        Objects.requireNonNull(aVar, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
        songCache.a(h.j(aVar.a(), track.getHighUrl()));
        if (SongCache.b == null) {
            SongCache.b = new SongCache();
        }
        SongCache songCache2 = SongCache.b;
        Objects.requireNonNull(songCache2, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.SongCache");
        if (d.c.b.z1.a.a == null) {
            d.c.b.z1.a.a = new d.c.b.z1.a();
        }
        d.c.b.z1.a aVar2 = d.c.b.z1.a.a;
        Objects.requireNonNull(aVar2, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
        songCache2.a(h.j(aVar2.a(), track.getLowUrl()));
    }

    public final void i(List<Track> list, String str) {
        String str2;
        String str3;
        if (list == null || list.isEmpty()) {
            return;
        }
        String str4 = this.f15499t.get(h.j(str, this.G));
        if (TextUtils.isEmpty(str4)) {
            str4 = k(h.j(str, this.G));
        }
        for (Track track : list) {
            if (track != null) {
                track.setRowId(((Object) track.getId()) + '_' + this.G);
            }
            if (track != null) {
                track.setAlbumId(str);
            }
            if (track != null) {
                track.setAlbumTitle(String.valueOf(str4));
            }
            if (track != null) {
                if (h.a(str, "shxg")) {
                    str3 = (String) this.f15485f.b(this, K[5]);
                } else {
                    str3 = (String) this.f15487h.b(this, K[7]);
                }
                track.setLowUrl(h.j(str3, track.getName()));
            }
            if (track != null) {
                if (h.a(str, "shxg")) {
                    str2 = (String) this.f15486g.b(this, K[6]);
                } else {
                    str2 = (String) this.f15488i.b(this, K[8]);
                }
                track.setHighUrl(h.j(str2, track.getName()));
            }
            if (track != null) {
                track.setType(str);
            }
            if (track != null) {
                track.setLan(this.G);
            }
        }
    }

    public final Album j(String str) {
        h.e(str, "albumId");
        d.c.b.s1.a aVar = this.B;
        if (aVar == null) {
            return null;
        }
        return aVar.v(h.j(str, this.G));
    }

    public final String k(String str) {
        h.e(str, "rowId");
        d.c.b.s1.a aVar = this.B;
        return String.valueOf(aVar == null ? null : aVar.q(str));
    }

    public final List<Track> l(Album album) {
        List<Track> F;
        h.e(album, "album");
        String id = album.getId();
        int hashCode = id.hashCode();
        if (hashCode == 3265302) {
            if (id.equals("jlsg")) {
                t tVar = this.D;
                F = tVar != null ? tVar.F("jlsg", "jlsg", this.G) : null;
                h.c(F);
            }
            if (h.a(album.getCategory(), "hymnAlbum")) {
            }
        } else if (hashCode == 3529732) {
            if (id.equals("shxg")) {
                t tVar2 = this.D;
                F = tVar2 != null ? tVar2.F("shxg", "shxg", this.G) : null;
                h.c(F);
            }
            if (h.a(album.getCategory(), "hymnAlbum")) {
            }
        } else {
            if (hashCode == 1366104126 && id.equals("newSongs")) {
                t tVar3 = this.D;
                F = tVar3 != null ? tVar3.c(this.G) : null;
                h.c(F);
            }
            if (h.a(album.getCategory(), "hymnAlbum")) {
                t tVar4 = this.D;
                F = tVar4 != null ? tVar4.Q(album.getId(), this.G) : null;
                h.c(F);
            } else {
                t tVar5 = this.D;
                F = tVar5 != null ? tVar5.F(album.getId(), album.getCategory(), this.G) : null;
                h.c(F);
            }
        }
        return F;
    }

    public final String m(String str, String str2, String str3) {
        String c;
        h.e(str, "category");
        h.e(str2, "albumId");
        h.e(str3, "trackLan");
        d.c.b.s1.c cVar = this.C;
        if (cVar == null) {
            c = null;
        } else {
            c = cVar.c(str2 + "fx" + str3);
        }
        return n(str, String.valueOf(c), str3);
    }

    public final String n(String str, String str2, String str3) {
        if (d.c.b.z1.a.a == null) {
            d.c.b.z1.a.a = new d.c.b.z1.a();
        }
        d.c.b.z1.a aVar = d.c.b.z1.a.a;
        Objects.requireNonNull(aVar, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
        String a2 = aVar.a();
        int hashCode = str.hashCode();
        if (hashCode != -1285060275) {
            if (hashCode != -905834836) {
                if (hashCode == 1080413836 && str.equals("reading")) {
                    StringBuilder J2 = i.a.b.a.a.J(a2);
                    if (d.c.b.z1.a.a == null) {
                        d.c.b.z1.a.a = new d.c.b.z1.a();
                    }
                    d.c.b.z1.a aVar2 = d.c.b.z1.a.a;
                    Objects.requireNonNull(aVar2, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
                    J2.append(aVar2.d(str3));
                    J2.append("md");
                    J2.append('/');
                    J2.append(str2);
                    return J2.toString();
                }
            } else if (str.equals("sermon")) {
                return "";
            }
        } else if (str.equals("dailyGodWord")) {
            StringBuilder J3 = i.a.b.a.a.J(a2);
            if (d.c.b.z1.a.a == null) {
                d.c.b.z1.a.a = new d.c.b.z1.a();
            }
            d.c.b.z1.a aVar3 = d.c.b.z1.a.a;
            Objects.requireNonNull(aVar3, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
            J3.append(aVar3.c(str3));
            J3.append("md");
            J3.append('/');
            J3.append(str2);
            return J3.toString();
        }
        StringBuilder J4 = i.a.b.a.a.J(a2);
        if (d.c.b.z1.a.a == null) {
            d.c.b.z1.a.a = new d.c.b.z1.a();
        }
        d.c.b.z1.a aVar4 = d.c.b.z1.a.a;
        Objects.requireNonNull(aVar4, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
        J4.append(aVar4.e(str3));
        J4.append("md");
        J4.append('/');
        J4.append(str2);
        return J4.toString();
    }

    public final AudioTheme o() {
        g gVar = this.F;
        if (gVar == null) {
            return null;
        }
        return gVar.q();
    }

    public final Track p(String str) {
        t tVar;
        if ((str == null || str.length() == 0) || (tVar = this.D) == null) {
            return null;
        }
        return tVar.k(((Object) str) + '_' + this.G);
    }

    public final void q(Track track) {
        t tVar = this.D;
        if (tVar != null) {
            tVar.J(track.getRowId(), 4);
        }
        if (track.getDeleteMark() > 0) {
            t tVar2 = this.D;
            if (tVar2 != null) {
                tVar2.a(track.getRowId());
            }
            c.b.a.a(track);
            h(track);
        }
    }

    public final void r(final Album album) {
        h.e(album, "album");
        n.m.t.a.p.m.e1.a.f2(new n.i.a.l<Request<AudioAlbumModel, BaseModel<AudioAlbumModel>>, n.e>() {

            @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001H\u008a@"}, d2 = {"<anonymous>", "Lorg/godfootsteps/arch/api/model/BaseModel;", "Lorg/godfootsteps/arch/api/model/AudioAlbumModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
            @n.g.f.a.c(c = "org.godfootsteps.audio.AudioRoom.AudioDataSource$refreshAlbumServerData$1$1", f = "AudioDataSource.kt", l = {318, 321, 324}, m = "invokeSuspend")
            public static final class AnonymousClass1 extends SuspendLambda implements n.i.a.l<n.g.c<? super BaseModel<AudioAlbumModel>>, Object> {
                public final Album $album;
                public int label;
                public final AudioDataSource this$0;

                public AnonymousClass1(Album album, AudioDataSource audioDataSource, n.g.c<? super AnonymousClass1> cVar) {
                    super(1, cVar);
                    this.$album = album;
                    this.this$0 = audioDataSource;
                }

                @Override
                public final n.g.c<n.e> create(n.g.c<?> cVar) {
                    return new AnonymousClass1(this.$album, this.this$0, cVar);
                }

                @Override
                public final Object invoke(n.g.c<? super BaseModel<AudioAlbumModel>> cVar) {
                    return ((AnonymousClass1) create(cVar)).invokeSuspend(n.e.a);
                }

                @Override
                public final Object invokeSuspend(Object obj) {
                    CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                    int i2 = this.label;
                    if (i2 != 0) {
                        if (i2 == 1) {
                            d.Q4(obj);
                            return (BaseModel) obj;
                        } else if (i2 == 2) {
                            d.Q4(obj);
                            return (BaseModel) obj;
                        } else if (i2 != 3) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        } else {
                            d.Q4(obj);
                            return (BaseModel) obj;
                        }
                    }
                    d.Q4(obj);
                    String category = this.$album.getCategory();
                    if (h.a(category, "reading")) {
                        Objects.requireNonNull(AppClient.a);
                        AppClient appClient = AppClient.Companion.f15176d;
                        String version = this.$album.getVersion();
                        String id = this.$album.getId();
                        String str = this.this$0.G;
                        this.label = 1;
                        obj = appClient.J(version, id, str, this);
                        if (obj == coroutineSingletons) {
                            return coroutineSingletons;
                        }
                        return (BaseModel) obj;
                    } else if (h.a(category, "dailyGodWord")) {
                        Objects.requireNonNull(AppClient.a);
                        AppClient appClient2 = AppClient.Companion.f15176d;
                        String version2 = this.$album.getVersion();
                        String id2 = this.$album.getId();
                        String str2 = this.this$0.G;
                        this.label = 2;
                        obj = appClient2.r0(version2, id2, str2, this);
                        if (obj == coroutineSingletons) {
                            return coroutineSingletons;
                        }
                        return (BaseModel) obj;
                    } else {
                        Objects.requireNonNull(AppClient.a);
                        AppClient appClient3 = AppClient.Companion.f15176d;
                        String version3 = this.$album.getVersion();
                        String id3 = this.$album.getId();
                        String str3 = this.this$0.G;
                        this.label = 3;
                        obj = appClient3.F(version3, id3, str3, this);
                        if (obj == coroutineSingletons) {
                            return coroutineSingletons;
                        }
                        return (BaseModel) obj;
                    }
                }
            }

            {
                super(1);
            }

            @Override
            public n.e invoke(Request<AudioAlbumModel, BaseModel<AudioAlbumModel>> request) {
                invoke2(request);
                return n.e.a;
            }

            public final void invoke2(Request<AudioAlbumModel, BaseModel<AudioAlbumModel>> request) {
                h.e(request, "$this$request");
                request.f(new AnonymousClass1(Album.this, this, null));
                final Album album2 = Album.this;
                final AudioDataSource audioDataSource = this;
                request.f15180l = new n.i.a.l<AudioAlbumModel, n.e>() {
                    {
                        super(1);
                    }

                    @Override
                    public n.e invoke(AudioAlbumModel audioAlbumModel) {
                        invoke2(audioAlbumModel);
                        return n.e.a;
                    }

                    public final void invoke2(AudioAlbumModel audioAlbumModel) {
                        ArrayList arrayList;
                        String j2;
                        String j3;
                        h.e(audioAlbumModel, "it");
                        String category = Album.this.getCategory();
                        if (h.a(category, "reading")) {
                            AudioDataSource audioDataSource2 = audioDataSource;
                            String valueOf = String.valueOf(audioAlbumModel.getLowUrl());
                            Objects.requireNonNull(audioDataSource2);
                            h.e(valueOf, "<set-?>");
                            PreferencesDelegate preferencesDelegate = audioDataSource2.f15489j;
                            k<?>[] kVarArr = AudioDataSource.K;
                            preferencesDelegate.a(audioDataSource2, kVarArr[9], valueOf);
                            AudioDataSource audioDataSource3 = audioDataSource;
                            String valueOf2 = String.valueOf(audioAlbumModel.getHighUrl());
                            Objects.requireNonNull(audioDataSource3);
                            h.e(valueOf2, "<set-?>");
                            audioDataSource3.f15490k.a(audioDataSource3, kVarArr[10], valueOf2);
                        } else if (h.a(category, "dailyGodWord")) {
                            AudioDataSource audioDataSource4 = audioDataSource;
                            String valueOf3 = String.valueOf(audioAlbumModel.getLowUrl());
                            Objects.requireNonNull(audioDataSource4);
                            h.e(valueOf3, "<set-?>");
                            PreferencesDelegate preferencesDelegate2 = audioDataSource4.f15493n;
                            k<?>[] kVarArr2 = AudioDataSource.K;
                            preferencesDelegate2.a(audioDataSource4, kVarArr2[13], valueOf3);
                            AudioDataSource audioDataSource5 = audioDataSource;
                            String valueOf4 = String.valueOf(audioAlbumModel.getHighUrl());
                            Objects.requireNonNull(audioDataSource5);
                            h.e(valueOf4, "<set-?>");
                            audioDataSource5.f15494o.a(audioDataSource5, kVarArr2[14], valueOf4);
                        } else {
                            AudioDataSource audioDataSource6 = audioDataSource;
                            String valueOf5 = String.valueOf(audioAlbumModel.getLowUrl());
                            Objects.requireNonNull(audioDataSource6);
                            h.e(valueOf5, "<set-?>");
                            PreferencesDelegate preferencesDelegate3 = audioDataSource6.f15491l;
                            k<?>[] kVarArr3 = AudioDataSource.K;
                            preferencesDelegate3.a(audioDataSource6, kVarArr3[11], valueOf5);
                            AudioDataSource audioDataSource7 = audioDataSource;
                            String valueOf6 = String.valueOf(audioAlbumModel.getHighUrl());
                            Objects.requireNonNull(audioDataSource7);
                            h.e(valueOf6, "<set-?>");
                            audioDataSource7.f15492m.a(audioDataSource7, kVarArr3[12], valueOf6);
                        }
                        AudioDataSource audioDataSource8 = audioDataSource;
                        String rowId = Album.this.getRowId();
                        String valueOf7 = String.valueOf(audioAlbumModel.getVersion());
                        a aVar = audioDataSource8.B;
                        if (aVar != null) {
                            aVar.n(rowId, valueOf7);
                        }
                        Album.this.setVersion(String.valueOf(audioAlbumModel.getVersion()));
                        List<Track> list = audioAlbumModel.getList();
                        List<TrackUpdate> update = audioAlbumModel.getUpdate();
                        AudioDataSource audioDataSource9 = audioDataSource;
                        Album album3 = Album.this;
                        Objects.requireNonNull(audioDataSource9);
                        if (!(list == null || list.isEmpty())) {
                            boolean a2 = h.a(album3.getCategory(), "sermon");
                            int i2 = 1;
                            for (Track track : list) {
                                track.setRowId(track.getId() + '_' + audioDataSource9.G);
                                track.setAlbumId(album3.getId());
                                track.setAlbumTitle(album3.getTitle());
                                if (a2) {
                                    track.setAlbumDetailTitle(album3.getDetailTitle());
                                }
                                String category2 = album3.getCategory();
                                if (h.a(category2, "reading")) {
                                    j2 = h.j((String) audioDataSource9.f15489j.b(audioDataSource9, AudioDataSource.K[9]), track.getName());
                                } else if (h.a(category2, "dailyGodWord")) {
                                    j2 = h.j((String) audioDataSource9.f15493n.b(audioDataSource9, AudioDataSource.K[13]), track.getName());
                                } else {
                                    j2 = h.j((String) audioDataSource9.f15491l.b(audioDataSource9, AudioDataSource.K[11]), track.getName());
                                }
                                track.setLowUrl(j2);
                                String category3 = album3.getCategory();
                                if (h.a(category3, "reading")) {
                                    j3 = h.j((String) audioDataSource9.f15490k.b(audioDataSource9, AudioDataSource.K[10]), track.getName());
                                } else if (h.a(category3, "dailyGodWord")) {
                                    j3 = h.j((String) audioDataSource9.f15494o.b(audioDataSource9, AudioDataSource.K[14]), track.getName());
                                } else {
                                    j3 = h.j((String) audioDataSource9.f15492m.b(audioDataSource9, AudioDataSource.K[12]), track.getName());
                                    track.setHighUrl(j3);
                                    track.setType(album3.getCategory());
                                    if (!a2) {
                                        track.setOrderNumberInt(i2);
                                        i2++;
                                    }
                                    track.setLan(audioDataSource9.G);
                                }
                                track.setHighUrl(j3);
                                track.setType(album3.getCategory());
                                if (!a2) {
                                }
                                track.setLan(audioDataSource9.G);
                            }
                        }
                        if (Album.this.getNeedUpdate() == 1) {
                            if (list == null) {
                                arrayList = null;
                            } else {
                                arrayList = new ArrayList(d.S(list, 10));
                                for (Track track2 : list) {
                                    arrayList.add(track2.getRowId());
                                }
                            }
                            Objects.requireNonNull(arrayList, "null cannot be cast to non-null type kotlin.collections.MutableList<kotlin.String>");
                            List<String> c = o.c(arrayList);
                            t tVar = audioDataSource.D;
                            audioDataSource.e(c, tVar != null ? tVar.O(Album.this.getId(), audioDataSource.G) : null, Album.this.getRowId());
                            AudioDataSource audioDataSource10 = audioDataSource;
                            Objects.requireNonNull(list, "null cannot be cast to non-null type java.util.ArrayList<org.godfootsteps.arch.api.entity.Track>{ kotlin.collections.TypeAliasesKt.ArrayList<org.godfootsteps.arch.api.entity.Track> }");
                            audioDataSource10.w((ArrayList) list, update, Album.this, false);
                            return;
                        }
                        AudioDataSource audioDataSource11 = audioDataSource;
                        Objects.requireNonNull(list, "null cannot be cast to non-null type java.util.ArrayList<org.godfootsteps.arch.api.entity.Track>{ kotlin.collections.TypeAliasesKt.ArrayList<org.godfootsteps.arch.api.entity.Track> }");
                        audioDataSource11.w((ArrayList) list, update, Album.this, false);
                    }
                };
                request.f15181m = new p<Integer, String, n.e>() {
                    @Override
                    public n.e invoke(Integer num, String str) {
                        invoke(num.intValue(), str);
                        return n.e.a;
                    }

                    public final void invoke(int i2, String str) {
                        h.e(str, "$noName_1");
                        d.d.a.c.b().g(new d.c.b.w1.c(2, false, null, 4));
                    }
                };
            }
        });
    }

    public final void s(boolean z) {
        if (this.H != -1 && System.currentTimeMillis() - this.H < 1800000 && ((Number) this.b.b(this, K[1])).intValue() > 0 && !z) {
            d.d.a.c.b().g(new d.c.b.w1.c(1, false, null, 4));
        } else {
            n.m.t.a.p.m.e1.a.f2(new n.i.a.l<Request<AudioModel, BaseModel<AudioModel>>, n.e>() {

                @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\u0010\u0000\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001H\u008a@"}, d2 = {"<anonymous>", "Lorg/godfootsteps/arch/api/model/BaseModel;", "Lorg/godfootsteps/arch/api/model/AudioModel;"}, k = 3, mv = {1, 5, 1}, xi = 48)
                @n.g.f.a.c(c = "org.godfootsteps.audio.AudioRoom.AudioDataSource$refreshServerData$1$1", f = "AudioDataSource.kt", l = {200}, m = "invokeSuspend")
                public static final class AnonymousClass1 extends SuspendLambda implements n.i.a.l<n.g.c<? super BaseModel<AudioModel>>, Object> {
                    public int label;
                    public final AudioDataSource this$0;

                    public AnonymousClass1(AudioDataSource audioDataSource, n.g.c<? super AnonymousClass1> cVar) {
                        super(1, cVar);
                        this.this$0 = audioDataSource;
                    }

                    @Override
                    public final n.g.c<n.e> create(n.g.c<?> cVar) {
                        return new AnonymousClass1(this.this$0, cVar);
                    }

                    @Override
                    public final Object invoke(n.g.c<? super BaseModel<AudioModel>> cVar) {
                        return ((AnonymousClass1) create(cVar)).invokeSuspend(n.e.a);
                    }

                    @Override
                    public final Object invokeSuspend(Object obj) {
                        d.c.i.d dVar;
                        CoroutineSingletons coroutineSingletons = CoroutineSingletons.COROUTINE_SUSPENDED;
                        int i2 = this.label;
                        if (i2 == 0) {
                            d.Q4(obj);
                            Objects.requireNonNull(AppClient.a);
                            AppClient appClient = AppClient.Companion.f15176d;
                            AudioDataSource audioDataSource = this.this$0;
                            PreferencesDelegate preferencesDelegate = audioDataSource.a;
                            k<?>[] kVarArr = AudioDataSource.K;
                            int intValue = ((Number) preferencesDelegate.b(audioDataSource, kVarArr[0])).intValue();
                            AudioDataSource audioDataSource2 = this.this$0;
                            int intValue2 = ((Number) audioDataSource2.b.b(audioDataSource2, kVarArr[1])).intValue();
                            AudioDataSource audioDataSource3 = this.this$0;
                            int intValue3 = ((Number) audioDataSource3.f15483d.b(audioDataSource3, kVarArr[3])).intValue();
                            AudioDataSource audioDataSource4 = this.this$0;
                            int intValue4 = ((Number) audioDataSource4.c.b(audioDataSource4, kVarArr[2])).intValue();
                            AudioDataSource audioDataSource5 = this.this$0;
                            int intValue5 = ((Number) audioDataSource5.f15484e.b(audioDataSource5, kVarArr[4])).intValue();
                            String str = this.this$0.G;
                            u0 u0Var = AudioSyncKt.a;
                            d.c.i.d dVar2 = (d.c.i.d) k.a.a.a.a.b(d.c.i.d.class);
                            String str2 = (!(dVar2 != null ? dVar2.h() : false) || (dVar = (d.c.i.d) k.a.a.a.a.b(d.c.i.d.class)) == null || (r4 = dVar.i()) == null) ? "" : "";
                            this.label = 1;
                            obj = appClient.n(intValue, intValue2, intValue3, intValue4, intValue5, str, str2, v.i() ? "pad" : "phone", this);
                            if (obj == coroutineSingletons) {
                                return coroutineSingletons;
                            }
                        } else if (i2 != 1) {
                            throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                        } else {
                            d.Q4(obj);
                        }
                        return obj;
                    }
                }

                {
                    super(1);
                }

                @Override
                public n.e invoke(Request<AudioModel, BaseModel<AudioModel>> request) {
                    invoke2(request);
                    return n.e.a;
                }

                public final void invoke2(Request<AudioModel, BaseModel<AudioModel>> request) {
                    h.e(request, "$this$request");
                    request.f(new AnonymousClass1(AudioDataSource.this, null));
                    final AudioDataSource audioDataSource = AudioDataSource.this;
                    request.f15180l = new n.i.a.l<AudioModel, n.e>() {
                        {
                            super(1);
                        }

                        @Override
                        public n.e invoke(AudioModel audioModel) {
                            invoke2(audioModel);
                            return n.e.a;
                        }

                        public final void invoke2(AudioModel audioModel) {
                            ImageUpdate imageUpdate;
                            List<ImageUpdateItem> dailyGodWord;
                            ImageUpdate imageUpdate2;
                            List<ImageUpdateItem> reading;
                            ImageUpdate imageUpdate3;
                            List<ImageUpdateItem> hymn;
                            h.e(audioModel, "audioModel");
                            boolean z2 = false;
                            if (audioModel.getHymns() == null && audioModel.getHymnList() == null && audioModel.getDailyGodWord() == null && audioModel.getReading() == null && audioModel.getHymnAlbum() == null && audioModel.getSermon() == null) {
                                d.d.a.c.b().g(new d.c.b.w1.c(1, false, null, 4));
                                d.d.a.c.b().g(new d.c.b.w1.a(1));
                                d.d.a.c.b().g(new d.c.b.w1.a(2));
                                return;
                            }
                            if (d.c.b.z1.a.a == null) {
                                d.c.b.z1.a.a = new d.c.b.z1.a();
                            }
                            d.c.b.z1.a aVar = d.c.b.z1.a.a;
                            Objects.requireNonNull(aVar, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
                            String baseUrl = audioModel.getBaseUrl();
                            if (baseUrl == null) {
                                baseUrl = "";
                            }
                            h.e(baseUrl, "baseUrl");
                            aVar.f().a.edit().putString("AudioBaseUrl", baseUrl).apply();
                            AudioDataSource audioDataSource2 = AudioDataSource.this;
                            Integer hymnsVersion = audioModel.getHymnsVersion();
                            int intValue = hymnsVersion == null ? -1 : hymnsVersion.intValue();
                            PreferencesDelegate preferencesDelegate = audioDataSource2.a;
                            k<?>[] kVarArr = AudioDataSource.K;
                            preferencesDelegate.a(audioDataSource2, kVarArr[0], Integer.valueOf(intValue));
                            AudioDataSource audioDataSource3 = AudioDataSource.this;
                            Integer hymnListVersion = audioModel.getHymnListVersion();
                            audioDataSource3.b.a(audioDataSource3, kVarArr[1], Integer.valueOf(hymnListVersion == null ? -1 : hymnListVersion.intValue()));
                            AudioDataSource audioDataSource4 = AudioDataSource.this;
                            Integer readingVersion = audioModel.getReadingVersion();
                            audioDataSource4.c.a(audioDataSource4, kVarArr[2], Integer.valueOf(readingVersion == null ? -1 : readingVersion.intValue()));
                            AudioDataSource audioDataSource5 = AudioDataSource.this;
                            Integer sermonVersion = audioModel.getSermonVersion();
                            audioDataSource5.f15484e.a(audioDataSource5, kVarArr[4], Integer.valueOf(sermonVersion == null ? -1 : sermonVersion.intValue()));
                            AudioDataSource audioDataSource6 = AudioDataSource.this;
                            Integer dailyGodWordVersion = audioModel.getDailyGodWordVersion();
                            audioDataSource6.f15483d.a(audioDataSource6, kVarArr[3], Integer.valueOf(dailyGodWordVersion != null ? dailyGodWordVersion.intValue() : -1));
                            if (d.c.b.z1.a.a == null) {
                                d.c.b.z1.a.a = new d.c.b.z1.a();
                            }
                            d.c.b.z1.a aVar2 = d.c.b.z1.a.a;
                            Objects.requireNonNull(aVar2, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
                            String imageSong = audioModel.getImageSong();
                            if (imageSong == null) {
                                imageSong = "";
                            }
                            h.e(imageSong, "path");
                            aVar2.f().j(h.j("imageSong", s.a()), imageSong);
                            if (d.c.b.z1.a.a == null) {
                                d.c.b.z1.a.a = new d.c.b.z1.a();
                            }
                            d.c.b.z1.a aVar3 = d.c.b.z1.a.a;
                            Objects.requireNonNull(aVar3, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
                            String imageDailyGodWord = audioModel.getImageDailyGodWord();
                            if (imageDailyGodWord == null) {
                                imageDailyGodWord = "";
                            }
                            h.e(imageDailyGodWord, "path");
                            aVar3.f().j(h.j("imageDailyGodWord", s.a()), imageDailyGodWord);
                            if (d.c.b.z1.a.a == null) {
                                d.c.b.z1.a.a = new d.c.b.z1.a();
                            }
                            d.c.b.z1.a aVar4 = d.c.b.z1.a.a;
                            Objects.requireNonNull(aVar4, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
                            String imageReading = audioModel.getImageReading();
                            String str = imageReading != null ? imageReading : "";
                            h.e(str, "path");
                            aVar4.f().j(h.j("imageReading", s.a()), str);
                            AudioDataSource.this.H = System.currentTimeMillis();
                            AudioDataSource audioDataSource7 = AudioDataSource.this;
                            audioDataSource7.A = true;
                            audioDataSource7.f15495p.clear();
                            AudioDataSource.this.f15496q.clear();
                            AudioDataSource.this.f15497r.clear();
                            AudioDataSource.this.f15499t.clear();
                            ImageUpdate imageUpdate4 = audioModel.getImageUpdate();
                            List<ImageUpdateItem> hymn2 = imageUpdate4 == null ? null : imageUpdate4.getHymn();
                            if (!(hymn2 == null || hymn2.isEmpty()) && (imageUpdate3 = audioModel.getImageUpdate()) != null && (hymn = imageUpdate3.getHymn()) != null) {
                                AudioDataSource audioDataSource8 = AudioDataSource.this;
                                for (ImageUpdateItem imageUpdateItem : hymn) {
                                    audioDataSource8.f15495p.add(String.valueOf(imageUpdateItem == null ? null : imageUpdateItem.getPicName()));
                                }
                            }
                            ImageUpdate imageUpdate5 = audioModel.getImageUpdate();
                            List<ImageUpdateItem> reading2 = imageUpdate5 == null ? null : imageUpdate5.getReading();
                            if (!(reading2 == null || reading2.isEmpty()) && (imageUpdate2 = audioModel.getImageUpdate()) != null && (reading = imageUpdate2.getReading()) != null) {
                                AudioDataSource audioDataSource9 = AudioDataSource.this;
                                for (ImageUpdateItem imageUpdateItem2 : reading) {
                                    audioDataSource9.f15496q.add(String.valueOf(imageUpdateItem2 == null ? null : imageUpdateItem2.getPicName()));
                                }
                            }
                            ImageUpdate imageUpdate6 = audioModel.getImageUpdate();
                            List<ImageUpdateItem> dailyGodWord2 = imageUpdate6 == null ? null : imageUpdate6.getDailyGodWord();
                            if (!(dailyGodWord2 == null || dailyGodWord2.isEmpty()) && (imageUpdate = audioModel.getImageUpdate()) != null && (dailyGodWord = imageUpdate.getDailyGodWord()) != null) {
                                AudioDataSource audioDataSource10 = AudioDataSource.this;
                                for (ImageUpdateItem imageUpdateItem3 : dailyGodWord) {
                                    audioDataSource10.f15497r.add(String.valueOf(imageUpdateItem3 == null ? null : imageUpdateItem3.getPicName()));
                                }
                            }
                            AudioDataSource.b(AudioDataSource.this, audioModel.getHymns(), "hymns");
                            AudioDataSource.b(AudioDataSource.this, audioModel.getHymnAlbum(), "hymnAlbum");
                            AudioDataSource.b(AudioDataSource.this, audioModel.getDailyGodWord(), "dailyGodWord");
                            AudioDataSource.b(AudioDataSource.this, audioModel.getReading(), "reading");
                            if (s.o()) {
                                AudioDataSource.b(AudioDataSource.this, audioModel.getSermon(), "sermon");
                            }
                            AudioDataSource audioDataSource11 = AudioDataSource.this;
                            Objects.requireNonNull(audioDataSource11);
                            if (audioModel.getHymnList() == null) {
                                d.d.a.c.b().g(new d.c.b.w1.a(1));
                            } else {
                                HymnList hymnList = audioModel.getHymnList();
                                String valueOf = String.valueOf(hymnList == null ? null : hymnList.getShxgLowUrl());
                                h.e(valueOf, "<set-?>");
                                PreferencesDelegate preferencesDelegate2 = audioDataSource11.f15485f;
                                k<?>[] kVarArr2 = AudioDataSource.K;
                                preferencesDelegate2.a(audioDataSource11, kVarArr2[5], valueOf);
                                HymnList hymnList2 = audioModel.getHymnList();
                                String valueOf2 = String.valueOf(hymnList2 == null ? null : hymnList2.getShxgHighUrl());
                                h.e(valueOf2, "<set-?>");
                                audioDataSource11.f15486g.a(audioDataSource11, kVarArr2[6], valueOf2);
                                HymnList hymnList3 = audioModel.getHymnList();
                                String valueOf3 = String.valueOf(hymnList3 == null ? null : hymnList3.getJlsgLowUrl());
                                h.e(valueOf3, "<set-?>");
                                audioDataSource11.f15487h.a(audioDataSource11, kVarArr2[7], valueOf3);
                                HymnList hymnList4 = audioModel.getHymnList();
                                String valueOf4 = String.valueOf(hymnList4 == null ? null : hymnList4.getJlsgHighUrl());
                                h.e(valueOf4, "<set-?>");
                                audioDataSource11.f15488i.a(audioDataSource11, kVarArr2[8], valueOf4);
                                if (d.c.b.z1.a.a == null) {
                                    d.c.b.z1.a.a = new d.c.b.z1.a();
                                }
                                d.c.b.z1.a aVar5 = d.c.b.z1.a.a;
                                Objects.requireNonNull(aVar5, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
                                HymnList hymnList5 = audioModel.getHymnList();
                                String valueOf5 = String.valueOf(hymnList5 == null ? null : hymnList5.getShxglyricsUrl());
                                h.e(valueOf5, "path");
                                aVar5.f().j(h.j("shxgLyricUrl", s.a()), valueOf5);
                                if (d.c.b.z1.a.a == null) {
                                    d.c.b.z1.a.a = new d.c.b.z1.a();
                                }
                                d.c.b.z1.a aVar6 = d.c.b.z1.a.a;
                                Objects.requireNonNull(aVar6, "null cannot be cast to non-null type org.godfootsteps.audio.config.AudioDataConfig");
                                HymnList hymnList6 = audioModel.getHymnList();
                                String valueOf6 = String.valueOf(hymnList6 == null ? null : hymnList6.getJlsglyricsUrl());
                                h.e(valueOf6, "path");
                                aVar6.f().j(h.j("jlsgLyricUrl", s.a()), valueOf6);
                                HymnList hymnList7 = audioModel.getHymnList();
                                List<Track> shxg = hymnList7 == null ? null : hymnList7.getShxg();
                                HymnList hymnList8 = audioModel.getHymnList();
                                List<Track> jlsg = hymnList8 == null ? null : hymnList8.getJlsg();
                                HymnList hymnList9 = audioModel.getHymnList();
                                List<TrackUpdate> update = hymnList9 == null ? null : hymnList9.getUpdate();
                                ArrayList<Track> arrayList = new ArrayList<>();
                                audioDataSource11.i(shxg, "shxg");
                                audioDataSource11.i(jlsg, "jlsg");
                                Objects.requireNonNull(shxg, "null cannot be cast to non-null type kotlin.collections.MutableList<org.godfootsteps.arch.api.entity.Track>");
                                arrayList.addAll(o.c(shxg));
                                Objects.requireNonNull(jlsg, "null cannot be cast to non-null type kotlin.collections.MutableList<org.godfootsteps.arch.api.entity.Track>");
                                arrayList.addAll(o.c(jlsg));
                                Album j2 = audioDataSource11.j("shxg");
                                if (j2 != null && j2.getNeedUpdate() == 1) {
                                    z2 = true;
                                }
                                if (z2) {
                                    ArrayList arrayList2 = new ArrayList(d.S(arrayList, 10));
                                    Iterator<Track> it = arrayList.iterator();
                                    while (it.hasNext()) {
                                        arrayList2.add(it.next().getRowId());
                                    }
                                    List<String> c = o.c(arrayList2);
                                    t tVar = audioDataSource11.D;
                                    audioDataSource11.e(c, tVar == null ? null : tVar.p(audioDataSource11.G), h.j("shxg", audioDataSource11.G));
                                    audioDataSource11.v(arrayList, update);
                                } else {
                                    audioDataSource11.v(arrayList, update);
                                }
                            }
                            d.d.a.c.b().g(new d.c.b.w1.c(1, true, null, 4));
                        }
                    };
                    final AudioDataSource audioDataSource2 = AudioDataSource.this;
                    request.f15181m = new p<Integer, String, n.e>() {
                        {
                            super(2);
                        }

                        @Override
                        public n.e invoke(Integer num, String str) {
                            invoke(num.intValue(), str);
                            return n.e.a;
                        }

                        public final void invoke(int i2, String str) {
                            h.e(str, "$noName_1");
                            AudioDataSource.this.H = System.currentTimeMillis();
                            d.d.a.c.b().g(new d.c.b.w1.c(1, false, null, 4));
                            d.d.a.c.b().g(new d.c.b.w1.a(1));
                            d.d.a.c.b().g(new d.c.b.w1.a(2));
                        }
                    };
                }
            });
        }
    }

    public final void t() {
        g gVar = this.F;
        if (gVar != null) {
            gVar.j();
        }
        g gVar2 = this.F;
        if (gVar2 == null) {
            return;
        }
        gVar2.h(1, "sgzt001");
    }

    public final void u(String str) {
        h.e(str, "selectId");
        g gVar = this.F;
        if (gVar != null) {
            gVar.j();
        }
        g gVar2 = this.F;
        if (gVar2 != null) {
            gVar2.h(1, str);
        }
        g gVar3 = this.F;
        if (gVar3 == null) {
            return;
        }
        gVar3.l();
    }

    public final void v(ArrayList<Track> arrayList, List<TrackUpdate> list) {
        Album album = new Album(null, null, null, null, 0, null, null, null, 0, 0, 0, null, null, 0, null, null, null, 131071, null);
        album.setCategory("hymns");
        w(arrayList, list, album, true);
    }

    public final void w(ArrayList<Track> arrayList, List<TrackUpdate> list, Album album, boolean z) {
        n.m.t.a.p.m.e1.a.o(n.m.t.a.p.m.e1.a.c(e0.b), null, null, new AudioDataSource$syncTrackToDB$1(arrayList, this, album, list, z, null), 3, null);
    }

    public final void x(List<Track> list) {
        t tVar;
        t tVar2;
        h.e(list, "trackList");
        if (list.isEmpty()) {
            return;
        }
        ArrayList arrayList = new ArrayList();
        ArrayList arrayList2 = new ArrayList();
        for (Track track : list) {
            t tVar3 = this.D;
            h.c(tVar3);
            Track k2 = tVar3.k(track.getRowId());
            if (k2 == null) {
                arrayList.add(track);
            } else {
                if (track.getOrderNumberInt() == 0) {
                    track.setOrderNumberInt(k2.getOrderNumberInt());
                }
                int downloaded = k2.getDownloaded();
                if ((downloaded == 0 || downloaded == 3) && ((track.getSizeLow() != k2.getSizeLow() || track.getSizeHigh() != k2.getSizeHigh()) && (h.a(track.getType(), "reading") || h.a(track.getType(), "dailyGodWord")))) {
                    h(track);
                }
                if (downloaded == 2) {
                    if (c0.a == null) {
                        c0.a = new c0();
                    }
                    c0 c0Var = c0.a;
                    Objects.requireNonNull(c0Var, "null cannot be cast to non-null type org.godfootsteps.audio.SongHelper.SongDownloadHelper");
                    File file = new File(c0Var.o(k2));
                    if (file.exists()) {
                        long length = file.length();
                        if (length != track.getSizeHigh() && length != track.getSizeLow()) {
                            h(track);
                            downloaded = 3;
                        }
                    }
                }
                track.setDownloaded(downloaded);
                arrayList2.add(track);
            }
        }
        if (arrayList.size() > 0 && (tVar2 = this.D) != null) {
            tVar2.b(arrayList);
        }
        if (arrayList2.size() <= 0 || (tVar = this.D) == null) {
            return;
        }
        tVar.I(arrayList2);
    }
}