Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
a0364d38
Commit
a0364d38
authored
Sep 29, 2008
by
Eric Wong
Committed by
Max Kellermann
Sep 29, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
directory: remove "Mp3" references
MPD has supported more audio formats than just MP3 for over five years...
parent
9819890f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
22 deletions
+22
-22
directory.c
src/directory.c
+17
-17
directory.h
src/directory.h
+2
-2
main.c
src/main.c
+3
-3
No files found.
src/directory.c
View file @
a0364d38
...
...
@@ -53,7 +53,7 @@ enum update_progress {
UPDATE_PROGRESS_DONE
=
2
}
progress
;
static
Directory
*
m
p3rootDirectory
;
static
Directory
*
m
usic_root
;
static
time_t
directory_dbModTime
;
...
...
@@ -138,7 +138,7 @@ static void * update_task(void *arg)
}
freeList
(
path_list
);
}
else
{
ret
=
updateDirectory
(
m
p3rootDirectory
);
ret
=
updateDirectory
(
m
usic_root
);
}
if
(
ret
==
UPDATE_RETURN_UPDATED
&&
writeDirectoryDB
()
<
0
)
...
...
@@ -315,7 +315,7 @@ static Directory *addDirectoryPathToDB(const char *utf8path)
parent
=
parent_path
(
path_max_tmp
,
utf8path
);
if
(
strlen
(
parent
)
==
0
)
parentDirectory
=
(
void
*
)
mp3rootDirectory
;
parentDirectory
=
music_root
;
else
parentDirectory
=
addDirectoryPathToDB
(
parent
);
...
...
@@ -351,7 +351,7 @@ static Directory *addParentPathToDB(const char *utf8path)
parent
=
parent_path
(
path_max_tmp
,
utf8path
);
if
(
strlen
(
parent
)
==
0
)
parentDirectory
=
(
void
*
)
mp3rootDirectory
;
parentDirectory
=
music_root
;
else
parentDirectory
=
addDirectoryPathToDB
(
parent
);
...
...
@@ -386,7 +386,7 @@ static enum update_return updatePath(const char *utf8path)
return
ret
;
}
/* we don't want to delete the root directory */
else
if
(
directory
==
m
p3rootDirectory
)
{
else
if
(
directory
==
m
usic_root
)
{
free
(
path
);
return
UPDATE_RETURN_NOUPDATE
;
}
...
...
@@ -618,9 +618,9 @@ addToDirectory(Directory * directory, const char *name)
return
UPDATE_RETURN_ERROR
;
}
void
closeMp3Directory
(
void
)
void
directory_finish
(
void
)
{
freeDirectory
(
m
p3rootDirectory
);
freeDirectory
(
m
usic_root
);
}
int
isRootDirectory
(
const
char
*
name
)
...
...
@@ -663,7 +663,7 @@ static Directory *getSubDirectory(Directory * directory, const char *name)
static
Directory
*
getDirectory
(
const
char
*
name
)
{
return
getSubDirectory
(
m
p3rootDirectory
,
name
);
return
getSubDirectory
(
m
usic_root
,
name
);
}
static
int
printDirectoryList
(
struct
client
*
client
,
struct
dirvec
*
dv
)
...
...
@@ -844,11 +844,11 @@ int writeDirectoryDB(void)
struct
stat
st
;
DEBUG
(
"removing empty directories from DB
\n
"
);
deleteEmptyDirectoriesInDirectory
(
m
p3rootDirectory
);
deleteEmptyDirectoriesInDirectory
(
m
usic_root
);
DEBUG
(
"sorting DB
\n
"
);
sortDirectory
(
m
p3rootDirectory
);
sortDirectory
(
m
usic_root
);
DEBUG
(
"writing DB
\n
"
);
...
...
@@ -865,7 +865,7 @@ int writeDirectoryDB(void)
fprintf
(
fp
,
"%s%s
\n
"
,
DIRECTORY_FS_CHARSET
,
getFsCharset
());
fprintf
(
fp
,
"%s
\n
"
,
DIRECTORY_INFO_END
);
writeDirectoryInfo
(
fp
,
m
p3rootDirectory
);
writeDirectoryInfo
(
fp
,
m
usic_root
);
while
(
fclose
(
fp
)
&&
errno
==
EINTR
);
...
...
@@ -881,8 +881,8 @@ int readDirectoryDB(void)
char
*
dbFile
=
getDbFile
();
struct
stat
st
;
if
(
!
m
p3rootDirectory
)
m
p3rootDirectory
=
newDirectory
(
NULL
,
NULL
);
if
(
!
m
usic_root
)
m
usic_root
=
newDirectory
(
NULL
,
NULL
);
while
(
!
(
fp
=
fopen
(
dbFile
,
"r"
))
&&
errno
==
EINTR
)
;
if
(
fp
==
NULL
)
{
ERROR
(
"unable to open db file
\"
%s
\"
: %s
\n
"
,
...
...
@@ -943,7 +943,7 @@ int readDirectoryDB(void)
DEBUG
(
"reading DB
\n
"
);
readDirectoryInfo
(
fp
,
m
p3rootDirectory
);
readDirectoryInfo
(
fp
,
m
usic_root
);
while
(
fclose
(
fp
)
&&
errno
==
EINTR
)
;
stats
.
numberOfSongs
=
countSongsIn
(
NULL
);
...
...
@@ -1007,10 +1007,10 @@ int traverseAllIn(const char *name,
data
);
}
void
initMp3Directory
(
void
)
void
directory_init
(
void
)
{
m
p3rootDirectory
=
newDirectory
(
NULL
,
NULL
);
exploreDirectory
(
m
p3rootDirectory
);
m
usic_root
=
newDirectory
(
NULL
,
NULL
);
exploreDirectory
(
m
usic_root
);
stats
.
numberOfSongs
=
countSongsIn
(
NULL
);
stats
.
dbPlayTime
=
sumSongTimesIn
(
NULL
);
}
...
...
src/directory.h
View file @
a0364d38
...
...
@@ -49,9 +49,9 @@ int isUpdatingDB(void);
*/
int
updateInit
(
List
*
pathList
);
void
initMp3Directory
(
void
);
void
directory_init
(
void
);
void
closeMp3Directory
(
void
);
void
directory_finish
(
void
);
int
isRootDirectory
(
const
char
*
name
);
...
...
src/main.c
View file @
a0364d38
...
...
@@ -280,7 +280,7 @@ static void openDB(Options * options, char *argv0)
flushWarningLog
();
if
(
checkDirectoryDB
()
<
0
)
exit
(
EXIT_FAILURE
);
initMp3Directory
();
directory_init
();
if
(
writeDirectoryDB
()
<
0
)
exit
(
EXIT_FAILURE
);
if
(
options
->
createDB
)
...
...
@@ -455,8 +455,8 @@ int main(int argc, char *argv[])
finishPlaylist
();
start
=
clock
();
closeMp3Directory
();
DEBUG
(
"
closeMp3Directory took %f seconds
\n
"
,
directory_finish
();
DEBUG
(
"
directory_finish took %f seconds
\n
"
,
((
float
)(
clock
()
-
start
))
/
CLOCKS_PER_SEC
);
deinit_main_notify
();
...
...
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