Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
d5c73c6d
Commit
d5c73c6d
authored
13 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
always scan new music files
parent
0c043561
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
apps/media/lib_media.php
+9
-17
9 additions, 17 deletions
apps/media/lib_media.php
with
9 additions
and
17 deletions
apps/media/lib_media.php
+
9
−
17
View file @
d5c73c6d
...
...
@@ -24,10 +24,8 @@
//we need to have the sha256 hash of passwords for ampache
OC_Hook
::
connect
(
'OC_User'
,
'post_login'
,
'OC_MEDIA'
,
'loginListener'
);
//connect to the filesystem for auto updating if configured
if
(
OC_Preferences
::
getValue
(
OC_User
::
getUser
(),
'media'
,
'autoupdate'
,
false
)){
OC_Hook
::
connect
(
'OC_Filesystem'
,
'post_write'
,
'OC_MEDIA'
,
'updateFile'
);
}
//connect to the filesystem for auto updating
OC_Hook
::
connect
(
'OC_Filesystem'
,
'post_write'
,
'OC_MEDIA'
,
'updateFile'
);
//listen for file deletions to clean the database if a song is deleted
OC_Hook
::
connect
(
'OC_Filesystem'
,
'delete'
,
'OC_MEDIA'
,
'deleteFile'
);
...
...
@@ -56,20 +54,14 @@ class OC_MEDIA{
*/
public
static
function
updateFile
(
$params
){
$path
=
$params
[
'path'
];
$folderNames
=
explode
(
PATH_SEPARATOR
,
OC_Preferences
::
getValue
(
OC_User
::
getUser
(),
'media'
,
'paths'
,
''
));
foreach
(
$folderNames
as
$folder
){
if
(
substr
(
$path
,
0
,
strlen
(
$folder
))
==
$folder
){
require_once
'lib_scanner.php'
;
require_once
'lib_collection.php'
;
//fix a bug where there were multiply '/' in front of the path, it should only be one
while
(
$path
[
0
]
==
'/'
){
$path
=
substr
(
$path
,
1
);
}
$path
=
'/'
.
$path
;
error_log
(
$path
);
OC_MEDIA_SCANNER
::
scanFile
(
$path
);
}
require_once
'lib_scanner.php'
;
require_once
'lib_collection.php'
;
//fix a bug where there were multiply '/' in front of the path, it should only be one
while
(
$path
[
0
]
==
'/'
){
$path
=
substr
(
$path
,
1
);
}
$path
=
'/'
.
$path
;
OC_MEDIA_SCANNER
::
scanFile
(
$path
);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment