Post FeedMedia event
This commit is contained in:
parent
23a3e7c766
commit
be1fde6f8e
|
@ -0,0 +1,24 @@
|
||||||
|
package de.danoeh.antennapod.core.event;
|
||||||
|
|
||||||
|
import de.danoeh.antennapod.core.feed.FeedMedia;
|
||||||
|
|
||||||
|
public class FeedMediaEvent {
|
||||||
|
|
||||||
|
public enum Action {
|
||||||
|
UPDATE
|
||||||
|
}
|
||||||
|
|
||||||
|
public final Action action;
|
||||||
|
public final FeedMedia media;
|
||||||
|
|
||||||
|
private FeedMediaEvent(Action action, FeedMedia media) {
|
||||||
|
this.action = action;
|
||||||
|
this.media = media;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FeedMediaEvent update(FeedMedia media) {
|
||||||
|
return new FeedMediaEvent(Action.UPDATE, media);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -9,10 +9,12 @@ import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import de.danoeh.antennapod.core.event.FeedMediaEvent;
|
||||||
import de.danoeh.antennapod.core.feed.FeedMedia;
|
import de.danoeh.antennapod.core.feed.FeedMedia;
|
||||||
import de.danoeh.antennapod.core.storage.DBReader;
|
import de.danoeh.antennapod.core.storage.DBReader;
|
||||||
import de.danoeh.antennapod.core.storage.DBWriter;
|
import de.danoeh.antennapod.core.storage.DBWriter;
|
||||||
import de.danoeh.antennapod.core.util.NetworkUtils;
|
import de.danoeh.antennapod.core.util.NetworkUtils;
|
||||||
|
import de.greenrobot.event.EventBus;
|
||||||
|
|
||||||
public class FeedMediaSizeService extends IntentService {
|
public class FeedMediaSizeService extends IntentService {
|
||||||
|
|
||||||
|
@ -48,6 +50,7 @@ public class FeedMediaSizeService extends IntentService {
|
||||||
}
|
}
|
||||||
media.setSize(size);
|
media.setSize(size);
|
||||||
DBWriter.setFeedMedia(this, media);
|
DBWriter.setFeedMedia(this, media);
|
||||||
|
EventBus.getDefault().post(FeedMediaEvent.update(media));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue