Commit d5681b67 authored by Max Kellermann's avatar Max Kellermann

db/update/Walk: move UpdatePlaylistFile() to Playlist.cxx

parent 0fd6235a
......@@ -27,6 +27,7 @@ db_glue_sources = [
'update/Walk.cxx',
'update/UpdateSong.cxx',
'update/Container.cxx',
'update/Playlist.cxx',
'update/Remove.cxx',
'update/ExcludeList.cxx',
'DatabaseGlue.cxx',
......
/*
* Copyright 2003-2019 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "Walk.hxx"
#include "db/DatabaseLock.hxx"
#include "db/PlaylistVector.hxx"
#include "db/plugins/simple/Directory.hxx"
#include "playlist/PlaylistRegistry.hxx"
#include "storage/FileInfo.hxx"
bool
UpdateWalk::UpdatePlaylistFile(Directory &directory,
const char *name, const char *suffix,
const StorageFileInfo &info) noexcept
{
if (!playlist_suffix_supported(suffix))
return false;
PlaylistInfo pi(name, info.mtime);
const ScopeDatabaseLock protect;
if (directory.playlists.UpdateOrInsert(std::move(pi)))
modified = true;
return true;
}
......@@ -22,12 +22,10 @@
#include "Editor.hxx"
#include "UpdateDomain.hxx"
#include "db/DatabaseLock.hxx"
#include "db/PlaylistVector.hxx"
#include "db/Uri.hxx"
#include "db/plugins/simple/Directory.hxx"
#include "db/plugins/simple/Song.hxx"
#include "storage/StorageInterface.hxx"
#include "playlist/PlaylistRegistry.hxx"
#include "ExcludeList.hxx"
#include "fs/AllocatedPath.hxx"
#include "fs/Traits.hxx"
......@@ -176,22 +174,6 @@ FindAncestorLoop(Storage &storage, Directory *parent,
}
inline bool
UpdateWalk::UpdatePlaylistFile(Directory &directory,
const char *name, const char *suffix,
const StorageFileInfo &info) noexcept
{
if (!playlist_suffix_supported(suffix))
return false;
PlaylistInfo pi(name, info.mtime);
const ScopeDatabaseLock protect;
if (directory.playlists.UpdateOrInsert(std::move(pi)))
modified = true;
return true;
}
inline bool
UpdateWalk::UpdateRegularFile(Directory &directory,
const char *name,
const StorageFileInfo &info) noexcept
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment