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
d14dcf55
Commit
d14dcf55
authored
Feb 22, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
e3d779ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
26 deletions
+32
-26
media.class.php
media.class.php
+32
-26
No files found.
media.class.php
View file @
d14dcf55
...
...
@@ -83,7 +83,7 @@ class Media {
}
public
function
filme
(
$action
=
"einlesen"
){
$start
=
time
();
if
(
$action
==
"einlesen"
){
//
if($action == "einlesen"){
//var_dump($this->config);
echo
$this
->
Console
->
getColoredString
(
"Filme > "
.
$action
,
"black"
,
"light_gray"
)
.
PHP_EOL
;
...
...
@@ -135,33 +135,38 @@ class Media {
$PfadOrg
=
(
strlen
(
$value
[
0
])
>
0
?
$value
[
0
]
.
'/'
:
''
);
$FilenameOrg
=
$value
[
1
];
$Endung
=
trim
(
substr
(
$FilenameOrg
,
strripos
(
$FilenameOrg
,
"."
)
+
1
));
//Was soll mit den geparsten Film gemacht werden?
if
(
$action
==
"einlesen"
){
if
(
$this
->
addMovie
(
$array
,
(
strlen
(
$value
[
0
])
>
0
?
$value
[
0
]
.
'/'
:
''
)
.
$value
[
1
],
false
)){
//TODO auf true für md5!!!
if
((
$Pfad
.
$FilenameOrg
)
==
(
$this
->
PfadzumAusgeben
.
(
$array
[
"3d"
]
==
""
?
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"Filme"
]
:
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"3D"
])
.
$Pfad
.
$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
$copy
.
"done!"
.
PHP_EOL
;
}
//TODO nfo file generieren
shell_exec
(
"mv './phpTestout/"
.
$array
[
"imdbID"
]
.
".txt' './phpTestout/OK_"
.
$array
[
"imdbID"
]
.
".txt'"
);
//return true;
if
(
$this
->
addMovie
(
$array
,
(
strlen
(
$value
[
0
])
>
0
?
$value
[
0
]
.
'/'
:
''
)
.
$value
[
1
],
false
)){
//TODO auf true für md5!!!
if
((
$Pfad
.
$FilenameOrg
)
==
(
$this
->
PfadzumAusgeben
.
(
$array
[
"3d"
]
==
""
?
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"Filme"
]
:
$this
->
config
[
"HDD"
][
$this
->
HDDID
][
"3D"
])
.
$Pfad
.
$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
$copy
.
"done!"
.
PHP_EOL
;
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;
}
//TODO nfo file generieren
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
if
(
$action
==
"update"
){
}
//TODO Baustelle Ende
}
...
...
@@ -199,7 +204,8 @@ class Media {
//trim(fgets(STDIN));
echo
PHP_EOL
;
//return ;
}
//}
/*
else if($action == "update"){
echo $this->Console->getColoredString("Filme > update", "black", "light_gray") .PHP_EOL;
...
...
@@ -272,7 +278,7 @@ class Media {
" Geändert: ".$counterChange.PHP_EOL.PHP_EOL;
echo $status;
file_put_contents("./phpTestout/update.txt", $status.PHP_EOL, FILE_APPEND);
}
}
*/
}
/**
* @param imdbID
...
...
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