diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-01-21 09:29:15 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-01-21 09:29:15 +0000 |
commit | 595b211d5e59e320586d09e16878b24bdb8b3375 (patch) | |
tree | fd6ce6b923a5416d94fb465ac435d2e53c86745e /bin | |
parent | 5a4fbeffbe12a6013f85d9d30aa29a60db77d9d7 (diff) | |
download | ampache-595b211d5e59e320586d09e16878b24bdb8b3375.tar.gz ampache-595b211d5e59e320586d09e16878b24bdb8b3375.tar.bz2 ampache-595b211d5e59e320586d09e16878b24bdb8b3375.zip |
updated german translations removed some old scripts that are no longer needed and potentially fixed another bug relating to windows and catalog building
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/archive/export_playlist.pl | 80 | ||||
-rwxr-xr-x | bin/archive/import_playlist.pl | 118 | ||||
-rwxr-xr-x | bin/archive/init | 11 | ||||
-rwxr-xr-x | bin/archive/migrate_user.pl | 56 | ||||
-rw-r--r-- | bin/dump_album_art.php.inc | 5 | ||||
-rwxr-xr-x | bin/moosic | 6 | ||||
-rwxr-xr-x | bin/moosicd | 6 |
7 files changed, 2 insertions, 280 deletions
diff --git a/bin/archive/export_playlist.pl b/bin/archive/export_playlist.pl deleted file mode 100755 index c6e0ccaf..00000000 --- a/bin/archive/export_playlist.pl +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/perl -w -# -# Exports playlists from ampache -# -# Fill in the site specific database connection parameters below before running -# - -use DBI; - -# Configure database connection parameters -my $db = "ampache"; # database -my $user = ""; # database user -my $pw = ""; # database user password - - -if ($#ARGV < 0) { - print "Usage: $0 <filename>\n"; - print " Exports Ampache playlists to <filename>.\n"; - exit; -} - - -open(OUT, "> $ARGV[0]") or die("Could not open '$ARGV[0]' for write - $!"); - -# Build DSNs -my $dsn = "dbi:mysql:database=$db;"; - -# Connect to database -my $dbh= DBI->connect($dsn, $user, $pw, - { RaiseError => 1, AutoCommit => 0 }); - - -# Prepare statements -my $sth = $dbh->prepare("SELECT id, name, owner, type FROM playlist"); -my $sth2 = $dbh->prepare("SELECT username FROM user - WHERE id = ?"); -my $sth3 = $dbh->prepare("SELECT song.file - FROM playlist_data, song - WHERE playlist_data.playlist = ? - AND playlist_data.song = song.id"); - -# Execute select and loop through results -$sth->execute(); -my $count = 0; -my ($id,$name,$owner,$type,$date,$file,$track); -while(($id,$name,$owner,$type) = $sth->fetchrow_array) { - if ($count > 0) { - # Use a blank line as a separator between playlists - print OUT "\n"; - } - - $count++; - - if ($owner =~ /^\d+$/) { - # Fetch username instead of id for owner - $sth2->execute($owner); - $owner = "unknown" unless (($owner) = $sth2->fetchrow_array); - $sth2->finish; - } - - # Date is not present in old ampache's - $date = 0 if (! defined($date)); - - print OUT "Name: $name\n"; - print OUT "Owner: $owner\n"; - print OUT "Type: $type\n"; - - # Grab songs for this playlist - $sth3->execute($id); - while(($file) = $sth3->fetchrow_array) { - print OUT "File: $file\n"; - } -} - -print "Exported $count playlists.\n"; - -# Clean up -$dbh->disconnect; -close(OUT); - diff --git a/bin/archive/import_playlist.pl b/bin/archive/import_playlist.pl deleted file mode 100755 index 4ce0e7b5..00000000 --- a/bin/archive/import_playlist.pl +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/perl -w -# -# Imports playlists into ampache (from export_playlist.pl output) -# -# Fill in the site specific database connection parameters below before running -# - -use DBI; -use Data::Dumper; - -# Configure database connection parameters -my $db = "ampache3_1"; # database -my $user = ""; # database user -my $pw = ""; # database user password - - -if ($#ARGV < 0) { - print "Usage: $0 <filename>\n"; - print " Imports Ampache playlists from <filename>.\n"; - print " The format of <filename> should match the output of export_playlist.pl.\n"; - exit; -} - - -open(IN, "$ARGV[0]") or die("Could not open '$ARGV[0]' for read - $!"); - -# Build DSNs -my $dsn = "dbi:mysql:database=$db;"; - -# Connect to database -my $dbh = DBI->connect($dsn, $user, $pw, - { RaiseError => 1, AutoCommit => 0 }); - - -# Structure to contain playlists -my @playlists; - -# Parse file -my $i = 0; -while($line = <IN>) { - chomp $line; - - if ($line eq "") { - # Blank line means new playlist - $i++; - next; - } - - if ($line =~ /^ID: (.*)$/) { - $playlists[$i]->{id} = $1; - } - - if ($line =~ /^Name: (.*)$/) { - $playlists[$i]->{name} = $1; - } - - if ($line =~ /^Owner: (.*)$/) { - $playlists[$i]->{owner} = $1; - } - - if ($line =~ /^Type: (.*)$/) { - $playlists[$i]->{type} = $1; - } - - if ($line =~ /^File: (.*)$/) { - push @{$playlists[$i]->{files}}, $1; - } -} -close(IN); - -# Prepare statements -my $sth = $dbh->prepare("SELECT id FROM user - WHERE username = ?"); -my $sth2 = $dbh->prepare("INSERT INTO playlist - (name, owner, type) - values (?, ?, ?)"); -my $sth3 = $dbh->prepare("SELECT id FROM song - WHERE file = ?"); -my $sth4 = $dbh->prepare("INSERT INTO playlist_data - (playlist, song, track) - values (?, ?, ?)"); - -# Insert records into Ampache -my ($id,$name,$owner,$type,$file,$songid); -my $count = 0; -for ($i = 0; $i < $#playlists + 1; $i++) { - $count++; - - $name = $playlists[$i]->{name}; - - $sth->execute($playlists[$i]->{owner}); - $owner = 0 unless (($owner) = $sth->fetchrow_array); - $sth->finish; - - $type = $playlists[$i]->{type}; - - print "Importing playlist '$name'...\n"; - - # Create base playlist entry - $sth2->execute($name, $owner, $type); - $id = $dbh->{mysql_insertid}; - - # And add files to it - while($file = pop(@{$playlists[$i]->{files}})) { - $sth3->execute($file); - next unless (($songid) = $sth3->fetchrow_array); - $sth3->finish; - - $sth4->execute($id,$songid,0); - } -} - -print "Imported $count playlists.\n"; - -# Clean up -$dbh->disconnect; -close(IN); - diff --git a/bin/archive/init b/bin/archive/init deleted file mode 100755 index 6d396cf5..00000000 --- a/bin/archive/init +++ /dev/null @@ -1,11 +0,0 @@ -#! /usr/bin/perl -# Copyleft Ampache.org - -# This script loads up the path to the perl module -# - -use FindBin qw($Bin); -use lib "$Bin/../lib/perl/Local/Ampache/blib/lib"; -use Local::Ampache; -$ampache = new Local::Ampache("$Bin/.."); - diff --git a/bin/archive/migrate_user.pl b/bin/archive/migrate_user.pl deleted file mode 100755 index cf36c868..00000000 --- a/bin/archive/migrate_user.pl +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/perl -w -# -# Migrates users from Ampache v3.0 to Ampache v3.1. -# -# Fill in the site specific database connection parameters below before running -# - -use DBI; - -# Configure database connection parameters -my $db_old = "ampache"; # old database -my $db_new = "ampache3_1"; # new database -my $user_old = ""; # old database user -my $user_new = ""; # new database user -my $pw_old = "!"; # old database user password -my $pw_new = "!"; # new database user password - - -# Build DSNs -my $dsn_new = "dbi:mysql:database=$db_new;"; -my $dsn_old = "dbi:mysql:database=$db_old;"; - - -# Connect to old and new databases -my $dbh_new = DBI->connect($dsn_new, $user_new, $pw_new, - { RaiseError => 1, AutoCommit => 0 }); - -my $dbh_old = DBI->connect($dsn_old, $user_old, $pw_old, - { RaiseError => 1, AutoCommit => 0 }); - - -# Prepare select and insert statements -my $sth = $dbh_old->prepare("SELECT username, fullname, email, password, access - FROM user"); - -my $sth_update = $dbh_new->prepare("INSERT INTO user - (username, fullname, email, password, access, offset_limit) - VALUES (?, ?, ?, ?, ?, 50)"); - - -# Execute select and loop through results -$sth->execute(); -my ($f1,$f2,$f3,$f4,$f5); -my $count = 0; -while(($f1,$f2,$f3,$f4,$f5) = $sth->fetchrow_array) { - $sth_update->execute($f1,$f2,$f3,$f4,$f5); - $count++; -} - -print "Migrated $count users.\n"; - - -# Clean up -$dbh_old->disconnect; -$dbh_new->disconnect; - diff --git a/bin/dump_album_art.php.inc b/bin/dump_album_art.php.inc index 8748cd41..bb64492f 100644 --- a/bin/dump_album_art.php.inc +++ b/bin/dump_album_art.php.inc @@ -5,9 +5,8 @@ All Rights Reserved 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. + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/bin/moosic b/bin/moosic deleted file mode 100755 index 1f9460ac..00000000 --- a/bin/moosic +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/python - -import sys -from moosic.client.cli.main import main - -main(sys.argv) diff --git a/bin/moosicd b/bin/moosicd deleted file mode 100755 index 70313995..00000000 --- a/bin/moosicd +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/python - -import sys -from moosic.server.main import main - -main(sys.argv) |