Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
MediaDBPythonScripte
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BA_SI-Projekt
MediaDBPythonScripte
Commits
295402cd
Commit
295402cd
authored
Feb 24, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
5471b970
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
34 deletions
+14
-34
media.class.php
media.class.php
+14
-34
No files found.
media.class.php
View file @
295402cd
...
...
@@ -513,32 +513,6 @@ class Media {
}
}
return
$array
;
/*if( $this->addMovie($array, $Pfad.$FilenameOrg)){
if(($Pfad.$FilenameOrg) == ($this->PfadzumAusgeben.($array["3d"]==""?$this->config["HDD"][$this->HDDID]["Filme"]:$this->config["HDD"][$this->HDDID]["3D"]).$PfadOrg.$array["name"]." (".$array["resolution"].")".($array["3d"] != ""?" (3D)":"")." (".$array["imdbID"].").".$Endung)){
echo "Datei liegt schon am ausgabe Ort!".PHP_EOL;
}
else{
if(!is_dir($this->PfadzumAusgeben.($array["3d"]==""?$this->config["HDD"][$this->HDDID]["Filme"]:$this->config["HDD"][$this->HDDID]["3D"]).$PfadOrg)){
shell_exec("mkdir '".$this->PfadzumAusgeben.($array["3d"]==""?$this->config["HDD"][$this->HDDID]["Filme"]:$this->config["HDD"][$this->HDDID]["3D"]).$PfadOrg."'");
}
echo "Verschiebe Datei...";
$copy = 'mv "'.
$Pfad.$FilenameOrg.'" "'.
$this->PfadzumAusgeben.($array["3d"]==""?$this->config["HDD"][$this->HDDID]["Filme"]:$this->config["HDD"][$this->HDDID]["3D"]).$PfadOrg.$array["name"]." (".$array["resolution"].")".($array["3d"] != ""?" (3D)":"")." (".$array["imdbID"].").".$Endung.'"';
file_put_contents("./phpTestout/".$array['imdbID'].".txt", $copy.PHP_EOL, FILE_APPEND);
shell_exec($copy);
echo "done!".PHP_EOL;
}
shell_exec("mv './phpTestout/".$array["imdbID"].".txt' './phpTestout/OK_".$array["imdbID"].".txt'");
return true;
}
else{
echo $this->Console->error("Fehler beim Eintragen in die DB!").PHP_EOL;
file_put_contents("./phpTestout/".$array["imdbID"].".txt", "Fehler beim Eintragen in die DB".PHP_EOL, FILE_APPEND);
return false;
}*/
}
else
{
echo
$this
->
Console
->
error
(
"Datei Existiert nicht!"
)
.
PHP_EOL
;
file_put_contents
(
"./phpTestout/default.txt"
,
"Datei existiert nicht: "
.
$Pfad
.
$Filename
.
PHP_EOL
,
FILE_APPEND
);
...
...
@@ -548,26 +522,32 @@ class Media {
private
function
GenerateNFO
(
$DataArr
,
$File
){
$nfoFile
=
substr
(
$File
,
0
,
strripos
(
$File
,
"."
))
.
".nfo"
;
// Echte NFO Ausgabe Pfad
$nfoFile
=
str_replace
(
"/media/QNAP/Filme"
,
"phpTestout"
,
$nfoFile
);
$nfoFile
=
str_replace
(
"/media/QNAP/Filme"
,
"phpTestout"
,
$nfoFile
);
// nur für Testausgaben drin....
$co
=
'<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'
.
PHP_EOL
;
$co
.=
'<movie>'
.
PHP_EOL
;
$co
.=
' <title>'
.
$DataArr
[
'name'
]
.
'</title>'
.
PHP_EOL
;
$co
.=
' <rating>'
.
$DataArr
[
'rating'
]
.
'</rating>'
.
PHP_EOL
;
$co
.=
' <year>'
.
$DataArr
[
'year'
]
.
'</year>'
.
PHP_EOL
;
$co
.=
' <plot>'
.
$DataArr
[
'summary'
]
.
'</plot>'
.
PHP_EOL
;
$co
.=
'</movie>'
.
PHP_EOL
;
if
(
!
$handle
=
fopen
(
$nfoFile
,
"'w+"
))
{
echo
"Kann die Datei
$nfoFile
nicht öffnen"
.
PHP_EOL
;
exit
;
}
// Schreibe $somecontent in die geöffnete Datei.
if
(
!
fwrite
(
$handle
,
$
somecontent
))
{
echo
"Kann in die Datei
$
filename
nicht schreiben"
;
if
(
!
fwrite
(
$handle
,
$
co
))
{
echo
"Kann in die Datei
$
nfoFile
nicht schreiben"
.
PHP_EOL
;
exit
;
}
echo
"Fertig, in Datei
$
filename
wurde
$somecontent
geschrieben"
;
echo
"Fertig, in Datei
$
nfoFile
wurde geschrieben"
.
PHP_EOL
;
fclose
(
$handle
);
echo
$nfoFile
.
""
.
PHP_EOL
;
//
echo $nfoFile."".PHP_EOL;
}
...
...
@@ -647,7 +627,7 @@ class Media {
$mysqli
->
query
(
"SET NAMES 'utf8'"
);
$Query
=
"SELECT imdbID FROM Filme WHERE imdbID = '"
.
$DataArr
[
'imdbID'
]
.
"' AND "
.
'3d '
.
(
$DataArr
[
'3d'
]
?
"!="
:
"="
)
.
'""'
;
echo
$Query
.
PHP_EOL
;
//
echo $Query.PHP_EOL;
$result
=
$mysqli
->
query
(
$Query
);
if
(
$mysqli
->
error
!=
""
){
echo
"Mysql-Fehler: "
.
$mysqli
->
error
.
PHP_EOL
;
return
false
;}
...
...
@@ -752,7 +732,7 @@ class Media {
else
{
$Query
=
"INSERT INTO Schauspieler (name, schauspielerID) VALUES('"
.
mysql_escape_string
((
$SchauspielerName
))
.
"', '"
.
$SchauspielerID
.
"');"
;
//echo PHP_EOL.$this->Console->getColoredString("Query", "light_gray", "green")." ".$Query.PHP_EOL;
echo
$SchauspielerName
.
", "
;
//
echo $SchauspielerName.", ";
$mysqli
->
query
(
$Query
);
return
$SchauspielerID
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment