merge with 1.0.2
This commit is contained in:
parent
73ac07339f
commit
c589a43a35
12 changed files with 117 additions and 56 deletions
|
@ -37,7 +37,6 @@ package="StorageAdmin"
|
||||||
reldir=`dirname $0`/..
|
reldir=`dirname $0`/..
|
||||||
basedir=`cd $reldir; pwd;`
|
basedir=`cd $reldir; pwd;`
|
||||||
test -z "$basedir" && basedir=.
|
test -z "$basedir" && basedir=.
|
||||||
usrdir=`cd $basedir/../../../usr; pwd;`
|
|
||||||
|
|
||||||
bindir=$basedir/bin
|
bindir=$basedir/bin
|
||||||
etcdir=$basedir/etc
|
etcdir=$basedir/etc
|
||||||
|
|
|
@ -36,14 +36,17 @@
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
reldir=`dirname $0`/..
|
reldir=`dirname $0`/..
|
||||||
basedir=`cd $reldir/var; pwd`
|
phpdir=ls_storageAdmin_phppart_dir
|
||||||
phpdir=`cd $reldir/var; pwd`
|
if [ "$phpdir" == "ls_storageAdmin_phppart_dir" ]
|
||||||
|
then
|
||||||
|
phpdir=`cd $reldir/var; pwd`
|
||||||
|
fi
|
||||||
mkdir -p $reldir/tmp
|
mkdir -p $reldir/tmp
|
||||||
tmpmaindir=`cd $reldir/tmp; pwd`
|
tmpmaindir=`cd $reldir/tmp; pwd`
|
||||||
dbxml="db.xml"
|
dbxml="db.xml"
|
||||||
datestr=`date '+%Y%m%d%H%M%S'`
|
datestr=`date '+%Y%m%d%H%M%S'`
|
||||||
tarfile0="xmls.tar"
|
xmltar="xmls.tar"
|
||||||
tarfile="storage$datestr.tar"
|
destfile="storage$datestr.tar"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Print the usage information for this script.
|
# Print the usage information for this script.
|
||||||
|
@ -94,7 +97,7 @@ destdir=`cd $destdir; pwd`
|
||||||
|
|
||||||
tmpdir=`mktemp -d $tmpmaindir/tmp.XXXXXX`
|
tmpdir=`mktemp -d $tmpmaindir/tmp.XXXXXX`
|
||||||
|
|
||||||
echo "Backuping to $destdir/$tarfile :"
|
echo "Backuping to $destdir/$destfile :"
|
||||||
echo "Dumping database ..."
|
echo "Dumping database ..."
|
||||||
cd $phpdir
|
cd $phpdir
|
||||||
php -q backup.php > $tmpdir/$dbxml
|
php -q backup.php > $tmpdir/$dbxml
|
||||||
|
@ -102,14 +105,14 @@ echo "Packaging stored files ..."
|
||||||
cd $phpdir
|
cd $phpdir
|
||||||
storpath=`php -q getStorPath.php`
|
storpath=`php -q getStorPath.php`
|
||||||
cd $storpath/..
|
cd $storpath/..
|
||||||
find stor -name "*.xml" -print | tar cf $tmpdir/$tarfile0 -T -
|
find stor -name "*.xml" -print | tar cf $tmpdir/$xmltar -T -
|
||||||
find stor ! -name "*.xml" -a -type f -print | tar cf $tmpdir/$tarfile -T -
|
find stor ! -name "*.xml" -a -type f -print | tar cf $tmpdir/$destfile -T -
|
||||||
cd $tmpdir
|
cd $tmpdir
|
||||||
tar rf $tarfile0 $dbxml --remove-files
|
tar rf $xmltar $dbxml --remove-files
|
||||||
echo "Compressing XML part ..."
|
echo "Compressing XML part ..."
|
||||||
bzip2 $tarfile0
|
bzip2 $xmltar
|
||||||
tar rf $tarfile $tarfile0.bz2 --remove-files
|
tar rf $destfile $xmltar.bz2 --remove-files
|
||||||
mv $tarfile "$destdir"
|
mv $destfile "$destdir"
|
||||||
rmdir $tmpdir
|
rmdir $tmpdir
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
|
@ -36,7 +36,11 @@
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
reldir=`dirname $0`/..
|
reldir=`dirname $0`/..
|
||||||
phpdir=`cd $reldir/var; pwd`
|
phpdir=ls_storageAdmin_phppart_dir
|
||||||
|
if [ "$phpdir" == "ls_storageAdmin_phppart_dir" ]
|
||||||
|
then
|
||||||
|
phpdir=`cd $reldir/var; pwd`
|
||||||
|
fi
|
||||||
filelistpathname=.
|
filelistpathname=.
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
|
@ -36,7 +36,11 @@
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
reldir=`dirname $0`/..
|
reldir=`dirname $0`/..
|
||||||
phpdir=`cd $reldir/var; pwd`
|
phpdir=ls_storageAdmin_phppart_dir
|
||||||
|
if [ "$phpdir" == "ls_storageAdmin_phppart_dir" ]
|
||||||
|
then
|
||||||
|
phpdir=`cd $reldir/var; pwd`
|
||||||
|
fi
|
||||||
filelistpathname=.
|
filelistpathname=.
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
@ -70,10 +74,12 @@ while true; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-d|--directory)
|
-d|--directory)
|
||||||
srcdir=$2;
|
srcdir=$2;
|
||||||
|
test -d $srcdir || { echo "Directory not found ($srcdir)."; exit 1; }
|
||||||
srcabsdir=`cd "$srcdir"; pwd`
|
srcabsdir=`cd "$srcdir"; pwd`
|
||||||
shift; shift;;
|
shift; shift;;
|
||||||
-l|--list)
|
-l|--list)
|
||||||
filelist=$2;
|
filelist=$2;
|
||||||
|
test -f $filelist || { echo "File not found ($filelist)."; exit 1; }
|
||||||
filelistbasename=`basename "$filelist"`
|
filelistbasename=`basename "$filelist"`
|
||||||
filelistdir=`dirname "$filelist"`
|
filelistdir=`dirname "$filelist"`
|
||||||
filelistabsdir=`cd "$filelistdir"; pwd`
|
filelistabsdir=`cd "$filelistdir"; pwd`
|
||||||
|
|
|
@ -36,14 +36,15 @@
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
reldir=`dirname $0`/..
|
reldir=`dirname $0`/..
|
||||||
basedir=`cd $reldir/var; pwd`
|
phpdir=ls_storageAdmin_phppart_dir
|
||||||
phpdir=`cd $reldir/var; pwd`
|
if [ "$phpdir" == "ls_storageAdmin_phppart_dir" ]
|
||||||
|
then
|
||||||
|
phpdir=`cd $reldir/var; pwd`
|
||||||
|
fi
|
||||||
mkdir -p $reldir/tmp
|
mkdir -p $reldir/tmp
|
||||||
tmpmaindir=`cd $reldir/tmp; pwd`
|
tmpmaindir=`cd $reldir/tmp; pwd`
|
||||||
dbxml="db.xml"
|
dbxml="db.xml"
|
||||||
#datestr=`date '+%Y%m%d%H%M%S'`
|
|
||||||
tarfile0="xmls.tar"
|
tarfile0="xmls.tar"
|
||||||
#tarfile="storage$datestr.tar"
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Print the usage information for this script.
|
# Print the usage information for this script.
|
||||||
|
|
|
@ -57,6 +57,7 @@ BASE_DIR = .
|
||||||
DOC_DIR = ${BASE_DIR}/doc
|
DOC_DIR = ${BASE_DIR}/doc
|
||||||
DOXYGEN_DIR = ${DOC_DIR}/doxygen
|
DOXYGEN_DIR = ${DOC_DIR}/doxygen
|
||||||
ETC_DIR = ${BASE_DIR}/etc
|
ETC_DIR = ${BASE_DIR}/etc
|
||||||
|
DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config
|
||||||
INCLUDE_DIR = ${BASE_DIR}/include
|
INCLUDE_DIR = ${BASE_DIR}/include
|
||||||
LIB_DIR = ${BASE_DIR}/lib
|
LIB_DIR = ${BASE_DIR}/lib
|
||||||
SRC_DIR = ${BASE_DIR}/src
|
SRC_DIR = ${BASE_DIR}/src
|
||||||
|
@ -67,30 +68,21 @@ BIN_DIR = ${BASE_DIR}/bin
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
|
|
||||||
USR_DIR = ${prefix}
|
USR_DIR = ${prefix}
|
||||||
USR_INCLUDE_DIR = ${USR_DIR}/include
|
|
||||||
USR_VAR_DIR = ${USR_DIR}/var
|
|
||||||
|
|
||||||
DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config
|
DEST_DIR = ${USR_DIR}
|
||||||
|
PHPPART_DIR = ${prefix}/var/LiveSupport/storageAdmin/var
|
||||||
|
STORAGE_SERVER = @STORAGE_SERVER@
|
||||||
|
|
||||||
PHP_DIR = ${VAR_DIR}
|
PHPPART_DIR_S=$(shell ${ECHO} ${PHPPART_DIR} | ${SED} -e "s/\//\\\\\\\\\//g")
|
||||||
#TEST_RUNNER = ${PHP_DIR}/tests/index.php
|
STORAGE_SERVER_S=$(shell ${ECHO} ${STORAGE_SERVER} | ${SED} -e "s/\//\\\\\\\\\//g")
|
||||||
|
|
||||||
#DEST_DIR = ${USR_VAR_DIR}/LiveSupport/storageAdmin/var
|
SED_STORAGE_SERVER="s/ls_storageServer/${STORAGE_SERVER_S}/;"
|
||||||
DEST_DIR = ${USR_DIR}/usr
|
SED_PHPPART_DIR="s/phpdir=ls_storageAdmin_phppart_dir/phpdir=${PHPPART_DIR_S}/;"
|
||||||
|
|
||||||
USR_VAR_DIR_S=$(shell ${ECHO} ${USR_VAR_DIR} | ${SED} -e "s/\//\\\\\\\\\//g")
|
|
||||||
|
|
||||||
REPLACE_SED_STRING="s/ls_var_dir/${USR_VAR_DIR_S}/;"
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Configuration parameters
|
# Configuration parameters
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
#CPPFLAGS = @CPPFLAGS@
|
|
||||||
#CXXFLAGS = @CXXFLAGS@ @DEFS@ -I${USR_INCLUDE_DIR} -I${INCLUDE_DIR} -I${TMP_DIR}\
|
|
||||||
# -pedantic -Wall
|
|
||||||
#LDFLAGS = @LDFLAGS@ -L${USR_LIB_DIR} -L${LIB_DIR}
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
@ -126,18 +118,24 @@ dist: all
|
||||||
distclean: clean docclean
|
distclean: clean docclean
|
||||||
# ${RMDIR} ${TMP_DIR}/config* ${TMP_DIR}/autom4te*
|
# ${RMDIR} ${TMP_DIR}/config* ${TMP_DIR}/autom4te*
|
||||||
|
|
||||||
#check: all ${TEST_RUNNER}
|
|
||||||
# ${TEST_RUNNER}
|
|
||||||
check: all
|
check: all
|
||||||
|
|
||||||
install:
|
install:
|
||||||
${MKDIR} ${DEST_DIR}/bin
|
${MKDIR} ${DEST_DIR}/bin
|
||||||
${CP} ${BIN_DIR}/*.sh ${DEST_DIR}/bin
|
${CP} ${BIN_DIR}/*.sh ${DEST_DIR}/bin
|
||||||
${RM} ${DEST_DIR}/bin/autogen.sh
|
${RM} ${DEST_DIR}/bin/autogen.sh
|
||||||
${MKDIR} ${DEST_DIR}/var
|
${CAT} ${BIN_DIR}/import.sh | ${SED} -e ${SED_PHPPART_DIR} \
|
||||||
${CP} ${VAR_DIR}/*.php ${DEST_DIR}/var
|
> ${DEST_DIR}/bin/import.sh
|
||||||
${CAT} ${VAR_DIR}/conf.php.template | ${SED} -e ${REPLACE_SED_STRING} \
|
${CAT} ${BIN_DIR}/backup.sh | ${SED} -e ${SED_PHPPART_DIR} \
|
||||||
> ${DEST_DIR}/var/conf.php
|
> ${DEST_DIR}/bin/backup.sh
|
||||||
|
${CAT} ${BIN_DIR}/restore.sh | ${SED} -e ${SED_PHPPART_DIR} \
|
||||||
|
> ${DEST_DIR}/bin/restore.sh
|
||||||
|
${CAT} ${BIN_DIR}/dumpDbSchema.sh | ${SED} -e ${SED_PHPPART_DIR} \
|
||||||
|
> ${DEST_DIR}/bin/dumpDbSchema.sh
|
||||||
|
${MKDIR} ${PHPPART_DIR}
|
||||||
|
${CP} ${VAR_DIR}/*.php ${PHPPART_DIR}
|
||||||
|
${CAT} ${VAR_DIR}/conf.php.template | ${SED} -e ${SED_STORAGE_SERVER} \
|
||||||
|
> ${PHPPART_DIR}/conf.php
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
|
@ -39,6 +39,41 @@ AC_REVISION($Revision$)
|
||||||
|
|
||||||
AC_CONFIG_SRCDIR(../var/getStorPath.php)
|
AC_CONFIG_SRCDIR(../var/getStorPath.php)
|
||||||
|
|
||||||
|
dnl-----------------------------------------------------------------------------
|
||||||
|
dnl specify directory with php parts of scripts
|
||||||
|
dnl-----------------------------------------------------------------------------
|
||||||
|
AC_SUBST(PHPPART_DIR)
|
||||||
|
|
||||||
|
AC_ARG_WITH([phppart-dir],
|
||||||
|
AC_HELP_STRING([--with-phppart-dir],
|
||||||
|
[directory with php parts of scripts]),
|
||||||
|
[PHPPART_DIR=${withval}], [PHPPART_DIR=${prefix}/var/LiveSupport/storageAdmin/var])
|
||||||
|
|
||||||
|
AC_MSG_RESULT([directory with php parts of scripts: ${PHPPART_DIR}])
|
||||||
|
|
||||||
|
dnl-----------------------------------------------------------------------------
|
||||||
|
dnl specify storageServer directory
|
||||||
|
dnl-----------------------------------------------------------------------------
|
||||||
|
AC_SUBST(STORAGE_SERVER)
|
||||||
|
|
||||||
|
AC_ARG_WITH([storage-server],
|
||||||
|
AC_HELP_STRING([--with-storage-server],
|
||||||
|
[use storageServer in given directory]),
|
||||||
|
[STORAGE_SERVER=${withval}], [STORAGE_SERVER=${prefix}/var/LiveSupport/storageServer])
|
||||||
|
|
||||||
|
AC_MSG_RESULT([using storageServer at: ${STORAGE_SERVER}])
|
||||||
|
|
||||||
|
dnl-----------------------------------------------------------------------------
|
||||||
|
dnl msg notice
|
||||||
|
dnl-----------------------------------------------------------------------------
|
||||||
|
AC_MSG_NOTICE(
|
||||||
|
[using the following configuration settings:
|
||||||
|
|
||||||
|
storageServer directory: ${STORAGE_SERVER}
|
||||||
|
php parts directory: ${PHPPART_DIR}
|
||||||
|
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
AC_CONFIG_FILES(../Makefile:../etc/Makefile.in)
|
AC_CONFIG_FILES(../Makefile:../etc/Makefile.in)
|
||||||
|
|
||||||
|
|
0
livesupport/src/modules/storageAdmin/tmp/.keepme
Normal file
0
livesupport/src/modules/storageAdmin/tmp/.keepme
Normal file
|
@ -122,7 +122,7 @@ function admDumpGroup(&$bs, $gid, $ind=''){
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
$garr = $bs->listGroup($gid);
|
$garr = $bs->listGroup($gid);
|
||||||
if(PEAR::isError($farr)){ echo $farr->getMessage(); exit; }
|
if(PEAR::isError($garr)){ echo $garr->getMessage(); exit; }
|
||||||
$res = '';
|
$res = '';
|
||||||
foreach($garr as $i =>$member){
|
foreach($garr as $i =>$member){
|
||||||
$fid2 = $member['id'];
|
$fid2 = $member['id'];
|
||||||
|
|
|
@ -28,5 +28,5 @@
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
$storageServerPath = 'ls_var_dir/LiveSupport/storageServer';
|
$storageServerPath = 'ls_storageServer';
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
Location : $URL$
|
Location : $URL$
|
||||||
|
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
ini_set('memory_limit', '64M');
|
||||||
header("Content-type: text/plain");
|
header("Content-type: text/plain");
|
||||||
echo "\n#StorageServer import script:\n";
|
echo "\n#StorageServer import script:\n";
|
||||||
//echo date('H:i:s')."\n";
|
//echo date('H:i:s')."\n";
|
||||||
|
@ -45,7 +46,7 @@ if(PEAR::isError($dbc)){ echo "ERROR: ".$dbc->getMessage()." ".$dbc->getUserInfo
|
||||||
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||||
$gb = &new GreenBox($dbc, $config);
|
$gb = &new GreenBox($dbc, $config);
|
||||||
|
|
||||||
$testonly = ($argv[1] == '-n');
|
$testonly = (isset($argv[1]) && $argv[1] == '-n');
|
||||||
#$testonly = TRUE;
|
#$testonly = TRUE;
|
||||||
|
|
||||||
$errors=0;
|
$errors=0;
|
||||||
|
@ -61,7 +62,13 @@ $flds = array(
|
||||||
'mime_type' => 'dc:format',
|
'mime_type' => 'dc:format',
|
||||||
'bitrate' => 'ls:bitrate',
|
'bitrate' => 'ls:bitrate',
|
||||||
'playtime_seconds' => 'dcterms:extent',
|
'playtime_seconds' => 'dcterms:extent',
|
||||||
'tags' => array(
|
/*
|
||||||
|
'id3v1' => array(
|
||||||
|
'title' => 'dc:title',
|
||||||
|
'artist' => 'dc:creator',
|
||||||
|
),
|
||||||
|
*/
|
||||||
|
'id3v2' => array(
|
||||||
'TT2' => 'dc:title',
|
'TT2' => 'dc:title',
|
||||||
'TIT2' => 'dc:title',
|
'TIT2' => 'dc:title',
|
||||||
'TP1' => 'dc:creator',
|
'TP1' => 'dc:creator',
|
||||||
|
@ -95,6 +102,8 @@ $flds = array(
|
||||||
);
|
);
|
||||||
|
|
||||||
$titleKey = 'dc:title';
|
$titleKey = 'dc:title';
|
||||||
|
$enc = 'iso-8859-1';
|
||||||
|
#$enc = 'UTF-8';
|
||||||
|
|
||||||
$r = $gb->getObjId('import', $gb->storId);
|
$r = $gb->getObjId('import', $gb->storId);
|
||||||
if(PEAR::isError($r)){ echo "ERROR: ".$r->getMessage()." ".$r->getUserInfo()."\n"; exit(1); }
|
if(PEAR::isError($r)){ echo "ERROR: ".$r->getMessage()." ".$r->getUserInfo()."\n"; exit(1); }
|
||||||
|
@ -104,16 +113,16 @@ if(is_null($r)){
|
||||||
}
|
}
|
||||||
$parid = $r;
|
$parid = $r;
|
||||||
|
|
||||||
function addMdata($key, $val){
|
function addMdata($key, $val, $iEnc='iso-8859-1'){
|
||||||
global $mdata, $titleHaveSet, $titleKey;
|
global $mdata, $titleHaveSet, $titleKey;
|
||||||
|
#echo "$key($iEnc): $val\n";
|
||||||
if(!is_null($val)){
|
if(!is_null($val)){
|
||||||
$mdata[$key] = $val;
|
$mdata[$key] = $val;
|
||||||
/*
|
|
||||||
$iEnc = 'UTF-8';
|
|
||||||
$oEnc = 'ISO-8859-1';
|
|
||||||
$oEnc = 'UTF-8';
|
$oEnc = 'UTF-8';
|
||||||
$mdata[$key] = iconv($iEnc, $oEnc, $mdata[$key]);
|
if(function_exists('iconv')){
|
||||||
*/
|
$mdata[$key] = $r = @iconv($iEnc, $oEnc, $mdata[$key]);
|
||||||
|
if($r === FALSE) die("Recoding metadata to unicode failed.");
|
||||||
|
}
|
||||||
if($key == $titleKey) $titleHaveSet = TRUE;
|
if($key == $titleKey) $titleHaveSet = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,18 +140,23 @@ while($filename = fgets($stdin, 2048)){
|
||||||
$mdata = array();
|
$mdata = array();
|
||||||
$titleHaveSet = FALSE;
|
$titleHaveSet = FALSE;
|
||||||
foreach($flds as $k1=>$fn1){
|
foreach($flds as $k1=>$fn1){
|
||||||
|
if($testonly) echo"#$k1, $fn1\n";
|
||||||
if(is_null($fn1)) continue;
|
if(is_null($fn1)) continue;
|
||||||
|
if(!isset($infoFromFile[$k1])) continue;
|
||||||
list($fn, $v) = array($fn1, $infoFromFile[$k1]);
|
list($fn, $v) = array($fn1, $infoFromFile[$k1]);
|
||||||
if(is_array($fn1)){
|
if(is_array($fn1)){
|
||||||
$k0 = $k1;
|
$k0 = $k1;
|
||||||
//if($k0=='tags') $k1=$infoFromFile['tags'][0];
|
//if($k0=='tags') $k1=$infoFromFile['tags'][0];
|
||||||
$k1 = 'id3v2';
|
//$k1 = 'id3v2';
|
||||||
|
if(!isset($infoFromFile[$k1])) continue;
|
||||||
list($fn, $v) = array($fn1, $infoFromFile[$k1]);
|
list($fn, $v) = array($fn1, $infoFromFile[$k1]);
|
||||||
foreach($fn1 as $k2=>$fn2){
|
foreach($fn1 as $k2=>$fn2){
|
||||||
|
if($testonly) echo" #$k2, $fn2\n";
|
||||||
if(is_null($fn2)) continue;
|
if(is_null($fn2)) continue;
|
||||||
if(!isset($infoFromFile[$k1][$k2])) continue;
|
if(!isset($infoFromFile[$k1][$k2])) continue;
|
||||||
switch($k0){
|
switch($k0){
|
||||||
case"tags":
|
case"tags":
|
||||||
|
case"id3v2":
|
||||||
list($fn, $v) = array($fn2, $infoFromFile[$k1][$k2]['data']);
|
list($fn, $v) = array($fn2, $infoFromFile[$k1][$k2]['data']);
|
||||||
$enc = $infoFromFile[$k1][$k2]['encoding'];
|
$enc = $infoFromFile[$k1][$k2]['encoding'];
|
||||||
if($enc != 'UTF-8' && $enc != 'ISO-8859-1'){
|
if($enc != 'UTF-8' && $enc != 'ISO-8859-1'){
|
||||||
|
@ -155,7 +169,8 @@ while($filename = fgets($stdin, 2048)){
|
||||||
default;
|
default;
|
||||||
list($fn, $v) = array($fn2, $infoFromFile[$k1][$k2]);
|
list($fn, $v) = array($fn2, $infoFromFile[$k1][$k2]);
|
||||||
}
|
}
|
||||||
addMdata($fn, $v);
|
if($testonly) echo" - $v\n";
|
||||||
|
addMdata($fn, $v, $enc);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
switch($fn){
|
switch($fn){
|
||||||
|
@ -165,10 +180,10 @@ while($filename = fgets($stdin, 2048)){
|
||||||
default:
|
default:
|
||||||
list($fn, $v) = array($fn1, $infoFromFile[$k1]);
|
list($fn, $v) = array($fn1, $infoFromFile[$k1]);
|
||||||
}
|
}
|
||||||
addMdata($fn, $v);
|
addMdata($fn, $v, $enc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!$titleHaveSet || trim($mdata[$titleKey])=='') addMdata($titleKey, basename($filename)." X");
|
if(!$titleHaveSet || trim($mdata[$titleKey])=='') addMdata($titleKey, basename($filename));
|
||||||
// unset($mdata['dc:title']);
|
// unset($mdata['dc:title']);
|
||||||
|
|
||||||
if(!$testonly){
|
if(!$testonly){
|
||||||
|
|
|
@ -75,7 +75,7 @@ function ls_restore_restoreObject($obj, $parid, $reallyInsert=TRUE){
|
||||||
$r = $bs->bsCreateFolder($parid, $obj['name']);
|
$r = $bs->bsCreateFolder($parid, $obj['name']);
|
||||||
ls_restore_checkErr($r, __LINE__);
|
ls_restore_checkErr($r, __LINE__);
|
||||||
}else $r=$parid;
|
}else $r=$parid;
|
||||||
if(is_array($obj['children'])){
|
if(isset($obj['children']) && is_array($obj['children'])){
|
||||||
foreach($obj['children'] as $i=>$ch){
|
foreach($obj['children'] as $i=>$ch){
|
||||||
ls_restore_restoreObject($ch, $r);
|
ls_restore_restoreObject($ch, $r);
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ foreach($subjArr as $i=>$el){
|
||||||
'pass' => $el->attrs['pass']->val,
|
'pass' => $el->attrs['pass']->val,
|
||||||
# 'realname' => $el->attrs['realname']->val,
|
# 'realname' => $el->attrs['realname']->val,
|
||||||
'realname' => '',
|
'realname' => '',
|
||||||
'prefs' => $el->children[0]->children,
|
'prefs' => (isset($el->children[0]) ? $el->children[0]->children : NULL),
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue