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
4ab4cf85
Commit
4ab4cf85
authored
Feb 07, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SongUpdate: pass Storage to UpdateFileInArchive()
parent
3341b282
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
SongUpdate.cxx
src/SongUpdate.cxx
+5
-4
Song.hxx
src/db/Song.hxx
+1
-1
No files found.
src/SongUpdate.cxx
View file @
4ab4cf85
...
...
@@ -25,7 +25,6 @@
#include "storage/FileInfo.hxx"
#include "util/UriUtil.hxx"
#include "util/Error.hxx"
#include "Mapper.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/Traits.hxx"
#include "fs/FileSystem.hxx"
...
...
@@ -54,7 +53,7 @@ Song::LoadFile(Storage &storage, const char *path_utf8, Directory &parent)
//in archive ?
bool
success
=
parent
.
device
==
DEVICE_INARCHIVE
?
song
->
UpdateFileInArchive
()
?
song
->
UpdateFileInArchive
(
storage
)
:
song
->
UpdateFile
(
storage
);
if
(
!
success
)
{
song
->
Free
();
...
...
@@ -115,7 +114,7 @@ Song::UpdateFile(Storage &storage)
}
bool
Song
::
UpdateFileInArchive
()
Song
::
UpdateFileInArchive
(
const
Storage
&
storage
)
{
/* check if there's a suffix and a plugin */
...
...
@@ -126,7 +125,9 @@ Song::UpdateFileInArchive()
if
(
!
decoder_plugins_supports_suffix
(
suffix
))
return
false
;
const
auto
path_fs
=
map_song_fs
(
*
this
);
const
auto
path_fs
=
parent
->
IsRoot
()
?
storage
.
MapFS
(
uri
)
:
storage
.
MapChildFS
(
parent
->
GetPath
(),
uri
);
if
(
path_fs
.
IsNull
())
return
false
;
...
...
src/db/Song.hxx
View file @
4ab4cf85
...
...
@@ -98,7 +98,7 @@ struct Song {
void
Free
();
bool
UpdateFile
(
Storage
&
storage
);
bool
UpdateFileInArchive
();
bool
UpdateFileInArchive
(
const
Storage
&
storage
);
/**
* Returns the URI of the song in UTF-8 encoding, including its
...
...
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