Merge pull request #1030 from TomHennen/fix1026_2

renamed checkedonSize
This commit is contained in:
Tom Hennen 2015-07-20 19:56:32 -04:00
commit ca0bc9e24d
2 changed files with 7 additions and 7 deletions

View File

@ -35,7 +35,7 @@ public class FeedMedia extends FeedFile implements Playable {
* 2) By default all FeedMedia have a size of 0 if we don't know it,
* so this won't conflict with existing practice.
*/
private static final int CHECKED_ON_SIZE = Integer.MIN_VALUE;
private static final int CHECKED_ON_SIZE_BUT_UNKNOWN = Integer.MIN_VALUE;
private int duration;
private int position; // Current position in file
@ -212,12 +212,12 @@ public class FeedMedia extends FeedFile implements Playable {
* Indicates we asked the service what the size was, but didn't
* get a valid answer and we shoudln't check using the network again.
*/
public void setCheckedOnSize() {
this.size = CHECKED_ON_SIZE;
public void setCheckedOnSizeButUnknown() {
this.size = CHECKED_ON_SIZE_BUT_UNKNOWN;
}
public boolean checkedOnSize() {
return (CHECKED_ON_SIZE == this.size);
public boolean checkedOnSizeButUnknown() {
return (CHECKED_ON_SIZE_BUT_UNKNOWN == this.size);
}
public String getMime_type() {

View File

@ -43,7 +43,7 @@ public class FeedMediaSizeService extends IntentService {
if(mediaFile.exists()) {
size = mediaFile.length();
}
} else if (false == media.checkedOnSize()) {
} else if (false == media.checkedOnSizeButUnknown()) {
// only query the network if we haven't already checked
HttpURLConnection conn = null;
try {
@ -63,7 +63,7 @@ public class FeedMediaSizeService extends IntentService {
}
if (size <= 0) {
// they didn't tell us the size, but we don't want to keep querying on it
media.setCheckedOnSize();
media.setCheckedOnSizeButUnknown();
} else {
media.setSize(size);
}