banshee & sqlite

Christian Hartnick christian at hartnick.de
Fr Jun 17 15:23:29 UTC 2011


> Ich bau mal weiter. Wer noch Ideen hat... Immer her damit
> Danke
> Knut
>
>
Ich hab mal 'nen kleine Perl-Skript gebastelt (weils mich selbst 
interessiert hat):

#!/usr/bin/perl

use strict;
use DBI;
my $dbargs = {AutoCommit => 0, PrintError => 1};
my $dbh = DBI->connect("dbi:SQLite:dbname=.config/banshee-1/banshee.db", 
"", "", $dbargs);

# Zeilen ausgeben
my $curartist = "";
my ($artist, $title) = "";
my $res = $dbh->selectall_arrayref("SELECT ArtistName,Title FROM 
CoreAlbums order by ArtistName;");
foreach my $row (@$res) {
   ($artist, $title) = @$row;
   if ($curartist ne $artist) { print("$artist\n") }
   print("  $title\n");
   $curartist = $artist;
}

if ($dbh->err()) { die "$DBI::errstr\n"; }
$dbh->disconnect();

Vielleicht hilft dir das.
Achtung: Du musst aus CPAN folgendes installieren:

# sudo perl -MCPAN -e shell
    cpan> install DBI
    cpan> install DBD::SQLite

Christian



Mehr Informationen über die Mailingliste ubuntu-de