From e92df126f179580fe0690db4f03e8542e8b9074c Mon Sep 17 00:00:00 2001 From: hummypkg Date: Tue, 30 Jan 2018 01:31:13 +0000 Subject: [PATCH] Use newer genre methods --- CONTROL/control | 4 ++-- webif/plugin/sweeper/auto.hook | 18 +++++------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/CONTROL/control b/CONTROL/control index c5aae43..1cf1063 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,9 +1,9 @@ Package: sweeper Priority: optional Section: misc -Version: 2.1.5-9 +Version: 2.1.5-10 Architecture: mipsel Maintainer: af123@hummypkg.org.uk -Depends: webif(>=1.4.0) +Depends: webif(>=1.4.2-10) Description: Sweeper is a package for managing recordings in a variety of ways using custom rules [Add %bfolder token] Tags: http://hummy.tv/forum/threads/5138/ diff --git a/webif/plugin/sweeper/auto.hook b/webif/plugin/sweeper/auto.hook index 742980f..32c3979 100644 --- a/webif/plugin/sweeper/auto.hook +++ b/webif/plugin/sweeper/auto.hook @@ -1,4 +1,6 @@ +require epg.class + set ::sweeper::cf "/mod/etc/sweeper.conf" set ::sweeper::dryrun 0 set ::sweeper::lastruleresult 0 @@ -195,13 +197,7 @@ proc ::sweeper::expand {ts str {orig ""}} { } #log "FNSTACK: $fnstack" 2 - set glist [ts genrelist] - set tsg [$ts get genre] - if {![dict exists $glist $tsg]} { - set genre "Unknown" - } else { - set genre [lindex $glist($tsg) 0] - } + lassign [$ts genre_info] genre set start [$ts get start] set timestamp [clock format $start -format "%Y%m%d%H%M%S"] @@ -543,12 +539,8 @@ proc ::sweeper::guidance {ts str folder} { } proc ::sweeper::genre {ts genre folder} { - set glist [ts genrelist] - - set tsg [$ts get genre] - if {![dict exists $glist $tsg]} { return 0 } - - if {[lindex $glist($tsg) 0] eq $genre} { return 1 } + lassign [$ts genre_info] tsgenre + if {$tsgenre eq $genre} { return 1 } return 0 }