mirror of
https://github.com/NiciDieNase/chaosflix
synced 2024-11-27 06:30:29 +00:00
fix search for optimal recording when there is no HD recording
This commit is contained in:
parent
f811fefbcb
commit
e6fa7661b3
1 changed files with 17 additions and 1 deletions
|
@ -162,9 +162,25 @@ public class Event extends SugarRecord implements Parcelable, Comparable<Event>
|
||||||
if(r.isHighQuality() && r.getMimeType().equals("video/mp4"))
|
if(r.isHighQuality() && r.getMimeType().equals("video/mp4"))
|
||||||
result.add(r);
|
result.add(r);
|
||||||
}
|
}
|
||||||
|
if(result.size()== 0){
|
||||||
|
for(Recording r : getRecordings()){
|
||||||
|
if(r.getMimeType().equals("video/mp4"))
|
||||||
|
result.add(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(result.size()== 0){
|
||||||
|
for(Recording r : getRecordings()){
|
||||||
|
if(r.getMimeType().startsWith("video/"))
|
||||||
|
result.add(r);
|
||||||
|
}
|
||||||
|
}
|
||||||
// sort by length of language-string in decending order, so first item has most languages
|
// sort by length of language-string in decending order, so first item has most languages
|
||||||
Collections.sort(result,(o1, o2) -> o2.getLanguage().length() - o1.getLanguage().length());
|
Collections.sort(result,(o1, o2) -> o2.getLanguage().length() - o1.getLanguage().length());
|
||||||
return result.get(0);
|
if(result.size() > 0){
|
||||||
|
return result.get(0);
|
||||||
|
} else {
|
||||||
|
return getRecordings().get(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getExtendedDescription(){
|
public String getExtendedDescription(){
|
||||||
|
|
Loading…
Reference in a new issue