Hi, ich hab ein Problem mit BeanShell. Ich versuche, einen Filter zu basteln, der mir nur Sendungen liefert, die ab z.B. 2017 produziert wurden.
Mein Code sieht so aus:
Code: Alles auswählen
import devplugin.beanshell.BeanShellProgramFilterIf;
import devplugin.Program;
import devplugin.ProgramFieldType;
accept(Program p) {
int year = p.gettField(ProgramFieldType.PRODUCTION_YEAR_TYPE);
if (year != null && year > 2017) {
return true;
}
}
return (BeanShellProgramFilterIf) this;
Leider bekomme ich eine Exception, Grund schein folgendes zu sein:
Code: Alles auswählen
Typed variable declaration : Error in method invocation: Method gettField( devplugin.ProgramFieldType ) not found in class'tvdataservice.MutableProgram' : at Line: 7 : in file: inline evaluation of: ``import devplugin.beanshell.BeanShellProgramFilterIf; import devplugin.Program; i . . . '' : p .gettField ( ProgramFieldType .PRODUCTION_YEAR_TYPE )
In der API Doku steht aber die Funktion drin:
www_tvbrowser_org/dev/api/tvbrowser_v2.7.6/doc/tvdataservice/MutableProgram.html#getIntField(devplugin.ProgramFieldType)
Bitte um Hilfe. Was mach ich denn falsch :/
LG Drophex
Hi, ich hab ein Problem mit BeanShell. Ich versuche, einen Filter zu basteln, der mir nur Sendungen liefert, die ab z.B. 2017 produziert wurden.
Mein Code sieht so aus:
[code]
import devplugin.beanshell.BeanShellProgramFilterIf;
import devplugin.Program;
import devplugin.ProgramFieldType;
accept(Program p) {
int year = p.gettField(ProgramFieldType.PRODUCTION_YEAR_TYPE);
if (year != null && year > 2017) {
return true;
}
}
return (BeanShellProgramFilterIf) this;
[/code]
Leider bekomme ich eine Exception, Grund schein folgendes zu sein:
[code]Typed variable declaration : Error in method invocation: Method gettField( devplugin.ProgramFieldType ) not found in class'tvdataservice.MutableProgram' : at Line: 7 : in file: inline evaluation of: ``import devplugin.beanshell.BeanShellProgramFilterIf; import devplugin.Program; i . . . '' : p .gettField ( ProgramFieldType .PRODUCTION_YEAR_TYPE )
[/code]
In der API Doku steht aber die Funktion drin:
www_tvbrowser_org/dev/api/tvbrowser_v2.7.6/doc/tvdataservice/MutableProgram.html#getIntField(devplugin.ProgramFieldType)
Bitte um Hilfe. Was mach ich denn falsch :/
LG Drophex