mirror of https://github.com/FongMi/TV.git
parent
e72d35e17a
commit
77d31d8963
@ -0,0 +1,57 @@ |
||||
package com.fongmi.android.tv.bean; |
||||
|
||||
import android.text.TextUtils; |
||||
|
||||
import com.google.gson.annotations.SerializedName; |
||||
|
||||
import java.util.regex.Matcher; |
||||
import java.util.regex.Pattern; |
||||
|
||||
public class Catchup { |
||||
|
||||
@SerializedName("type") |
||||
private String type; |
||||
@SerializedName("days") |
||||
private String days; |
||||
@SerializedName("source") |
||||
private String source; |
||||
|
||||
public static Catchup PLTV() { |
||||
Catchup item = new Catchup(); |
||||
item.setDays("7"); |
||||
item.setType("append"); |
||||
item.setSource("?playseek=${(b)yyyyMMddHHmmss}-${(e)yyyyMMddHHmmss}"); |
||||
return item; |
||||
} |
||||
|
||||
public String getType() { |
||||
return TextUtils.isEmpty(type) ? "" : type; |
||||
} |
||||
|
||||
public void setType(String type) { |
||||
this.type = type; |
||||
} |
||||
|
||||
public String getDays() { |
||||
return TextUtils.isEmpty(days) ? "" : days; |
||||
} |
||||
|
||||
public void setDays(String days) { |
||||
this.days = days; |
||||
} |
||||
|
||||
public String getSource() { |
||||
return TextUtils.isEmpty(source) ? "" : source; |
||||
} |
||||
|
||||
public void setSource(String source) { |
||||
this.source = source; |
||||
} |
||||
|
||||
public String format(EpgData data) { |
||||
String result = getSource(); |
||||
Matcher matcher = Pattern.compile("(\\$\\{[^}]*\\})").matcher(result); |
||||
while (matcher.find()) result = result.replace(matcher.group(1), data.format(matcher.group(1))); |
||||
return result; |
||||
} |
||||
} |
||||
Loading…
Reference in new issue