|
|
|
|
@ -169,17 +169,13 @@ public class History { |
|
|
|
|
return AppDatabase.get().getHistoryDao().find(ApiConfig.getCid(), key); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static void delete(int id) { |
|
|
|
|
AppDatabase.get().getHistoryDao().delete(id); |
|
|
|
|
public static void delete(int cid) { |
|
|
|
|
AppDatabase.get().getHistoryDao().delete(cid); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void checkDuplicate() { |
|
|
|
|
public History update(long duration) { |
|
|
|
|
History history = AppDatabase.get().getHistoryDao().findByName(ApiConfig.getCid(), getVodName()); |
|
|
|
|
if (history != null) AppDatabase.get().getHistoryDao().delete(ApiConfig.getCid(), history.getKey()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public History update(long duration) { |
|
|
|
|
checkDuplicate(); |
|
|
|
|
setDuration(duration); |
|
|
|
|
AppDatabase.get().getHistoryDao().insertOrUpdate(this); |
|
|
|
|
return this; |
|
|
|
|
|