MythTV Tatort PowerSearch
Ziel der Übung: Nur Tatorte aus den in den letzten X Jahren aufnehmen.
Leider wird über DVB wohl weder “originairdate” noch “airdate” mitübertragen, so dass ein einfacher Powersearch mit:
program.title LIKE 'tatort:%' AND program.airdate >= YEAR(SUBDATE(CURDATE(), INTERVAL 5 YEAR))
nicht funktioniert…. Mal ganz abgesehen davon, dass ich egentlich gar nicht weiß ob jetzt die spalte “originalairdate” oder doch eher die Spalte “airdate” die richtige wäre…
Das gute ist nun, das wenigstens im “subtitle” oder der “description” (meistens) sowas wie “Fernsehfilm Deutschland 2007″ drinne steht.
Mit der nachfolgenden kleinen MySQL Funktion lassen sich diese Information dennoch nutzen. Die Funktion erzeugt einen Regulären Ausdruck welcher welcher auf eine bestimmte Anzahl von Jahren passt:
DROP Function IF EXISTS YearsRegexp;
/*
Creates a list of years which may be use in regular expressions.
For example calling the function in the year 2010 produces the
follwing output:
mysql> SELECT YearsRegexp(5);
+----------------------------+
| YearsRegexp(5) |
+----------------------------+
| (2007|2008|2009|2010|2011) |
+----------------------------+
1 row in set (0.00 sec)
mysql>
*/
DELIMITER //
CREATE Function YearsRegexp(years INTEGER)
Returns varchar(252)
NOT DETERMINISTIC /*every new year will produce different results...*/
BEGIN
DECLARE exp VARCHAR(252) DEFAULT '(';
Set years = IF(years>50,50,years); /*so the result will fit into exp*/
Set years = years - 1;
WHILE years >= 0 DO
set exp = CONCAT(exp, year(subdate(curdate(),interval years year)),IF(years>0,'|',''));
Set years = years - 1;
END WHILE;
return CONCAT(exp,')');
END
//
delimiter ;
select YearsRegexp(5);
select chanid,starttime,title,subtitle from program where program.title like 'tatort:%' and ( program.subtitle REGEXP CONCAT('.*',YearsRegexp(5)) OR program.description REGEXP CONCAT('.*',YearsRegexp(5)));
Im Powersearch kann jetzt die where clause aus dem letzten Statement verwendet werden:
program.title like 'tatort:%' and ( program.subtitle REGEXP CONCAT('.*',YearsRegexp(5)) OR program.description REGEXP CONCAT('.*',YearsRegexp(5)))
Und nun noch der obligatorische Screenshot:

Und das Kleingedruckte:
Leider wird die Funktion nicht in die von mythtv erstellten Datenbankbackups mit auf genommen und muss nach dem restore erst wieder von Hand in die mythconverg gebracht werden, damit der powersearch wieder funktioniert.
konica minolta magicolor 2530DL with gentoo
Getting magicolor 2530DLÂ printer to play nice with cups is, at least on gentoo, somewhat tricky.
I’m using the source package from here:
http://printer.konicaminolta.com/support/current_printers/mc2530dl_sup.htm#linux
but their buildscript is broken for gentoo, since a
./configure
make
produces the following output:
rastertokmlf.c:1235: warning: ‘cupsTempFile’ is deprecated (declared at /usr/include/cups/cups.h:164)
if gcc -DHAVE_CONFIG_H -I. -I. -I..    -g -O2 -MT bmp.o -MD -MP -MF ".deps/bmp.Tpo" -c -o bmp.o bmp.c; \
then mv -f ".deps/bmp.Tpo" ".deps/bmp.Po"; else rm -f ".deps/bmp.Tpo"; exit 1; fi
bmp.c: In function ‘getHalftoneByResolution’:
bmp.c:200: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘DWORD’
bmp.c:200: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘DWORD’
gcc -g -O2  -o rastertokm2530dl rastertokmlf.o bmp.o /usr/lib/liblcms.a /usr/lib/libjbig.a -lcupsimage -lcups
gcc: /usr/lib/liblcms.a: No such file or directory
make[2]: *** [rastertokm2530dl] Error 1
make[2]: Leaving directory `/home/tob/tmp/magicolor2530DL-2.1.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/tob/tmp/magicolor2530DL-2.1.0'
make: *** [all] Error 2
to get it to compile i had to emerge lcms-1.19 with static-libs enabled (the current verion 2.xx don’t work):
echo media-libs/lcms static-libs >> /etc/portage/package.use
emerge -av =media-libs/lcms-1.19
after lcms was emerged it compiled fine. But make install moved rastertokm2530dl to a directory which is (no longer?) used by cups..
i also had to copy the file where cups is actually looking for it:
cp /usr/lib/cups/filter/rastertokm2530dl /usr/libexec/cups/filter/
Hope this helps someone out there…
It is the year 2010, why the heck is printing still such a pile of crap?! And the OS doesn’t matter at all, getting the printer to work with win7 was a major PITA too…

geschrieben von
