# HG changeset patch # User Stiletto # Date 1308399072 -14400 # Node ID 1928f1a1ee5bc5c6396cd359c783062b2b2e9ca9 # Parent f0c87fb62b666f1262d4d7399a16241d212afe04 cos-list diff -r f0c87fb62b66 -r 1928f1a1ee5b cos-list.cxx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cos-list.cxx Sat Jun 18 16:11:12 2011 +0400 @@ -0,0 +1,56 @@ +/* cos-search.cxx: + * based on quickstartsearch.cc: Simplest possible searcher + * + * ----START-LICENCE---- + * Copyright 1999,2000,2001 BrightStation PLC + * Copyright 2003,2004 Olly Betts + * Copyright 2011 Stiletto + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 + * USA + */ + +#include +#include +#include +#include +#include + +using namespace std; + +int main(int argc, char **argv) +{ + // Simplest possible options parsing: we just require two or more + // parameters. + if (argc < 3) { + cout << "usage: " << argv[0] << + " " << endl; + exit(1); + } + + // Catch any Xapian::Error exceptions thrown + try { + Xapian::Database db(argv[1]); + Xapian::Enquire enquire(db); + Xapian::QueryParser qp; + string qstring = string(argv[2])+":"; + std::transform(qstring.begin(), qstring.end(), qstring.begin(), ::toupper); + + for (Xapian::TermIterator ti = db.allterms_begin(qstring);ti!=db.allterms_end(qstring);ti++) + cout << *ti << endl; + } catch(const Xapian::Error &error) { + cerr << "Exception: " << error.get_msg() << endl; + } +} diff -r f0c87fb62b66 -r 1928f1a1ee5b extractors/ext-mpg123 --- a/extractors/ext-mpg123 Sat Feb 12 17:03:08 2011 +0300 +++ b/extractors/ext-mpg123 Sat Jun 18 16:11:12 2011 +0400 @@ -1,6 +1,21 @@ #!/bin/sh echo "$1" -mpg123 -vtn1 --long-tag "$1" 2>&1|awk '/^\t.*:/ {match($0,"\t(.*): +(.*)",a); print toupper(a[1])":"a[2]; }' +TFILE=$(mktemp) +TFILE2=$(mktemp) +mpg123 -vtn1 --long-tag "$1" 2>&1|awk '/^\t.*:/ {match($0,"\t(.*): +(.*)",a); print toupper(a[1])":"a[2]; }' > $TFILE +if iconv -s -f utf-8 -t latin1 $TFILE > $TFILE2 && iconv -s -f utf-8 -t utf-8 $TFILE2 > /dev/null; then + echo "ENCODINGHACK:DOUBLE-UTF-8" + cat $TFILE2 +else + if iconv -s -f utf-8 -t latin1 $TFILE > $TFILE2 && iconv -s -f cp1251 -t utf-8 $TFILE2 > /dev/null; then + iconv -s -f cp1251 -t utf-8 $TFILE2 + echo "ENCODINGHACK:CP1251" + else + echo "ENCODING:UTF-8" + cat "$TFILE" + fi +fi +rm -f $TFILE $TFILE2 echo diff -r f0c87fb62b66 -r 1928f1a1ee5b scanscript.sh --- a/scanscript.sh Sat Feb 12 17:03:08 2011 +0300 +++ b/scanscript.sh Sat Jun 18 16:11:12 2011 +0400 @@ -5,6 +5,6 @@ if [ "$EXT" == "mp3" ];then $PROGDIR/extractors/ext-mpg123 "$fname" else - true#$PROGDIR/extractors/ext-taglib "$fname" + true #$PROGDIR/extractors/ext-taglib "$fname" fi done