Commit Graph

29 Commits

Author SHA1 Message Date
Max Kellermann
ca419c84b8 stored_playlist: return GError, code is playlist_result
Improve error reporting and handling.  command.c gets the new function
print_error(), which sends a GError to the client.
2011-09-11 07:57:50 +02:00
Max Kellermann
aede71b1dc playlist: move enum playlist_result to playlist_error.h
Reduce header dependencies.
2011-09-11 07:55:51 +02:00
Max Kellermann
c6cbcc2c25 copyright year 2011 2011-01-29 10:13:54 +01:00
Max Kellermann
b6995ca011 player_control: removed the global variable "pc"
Allocate a player_control object where needed, and pass it around.
Each "client" object is associated with a "player_control" instance.

This prepares multi-player support.
2011-01-10 19:46:23 +01:00
Avuton Olrich
9d3865cb95 Update copyright notices. 2009-12-31 20:58:43 -08:00
Max Kellermann
c3085d7b61 Merge branch 'v0.15.x'
Conflicts:
	src/decoder/ffmpeg_plugin.c
2009-12-14 17:40:50 +01:00
Max Kellermann
f4b707b4ca mapper: apply filesystem_charset to playlists
This fixes an inconsistency in the stored playlist subsystem: when
obtaining the list of playlists (listplaylist, listplaylistinfo), the
file names in the playlist directory are converted to UTF-8 (according
to filesystem_charset), but when saving or loading playlists, the
filesystem_charset setting was ignored.
2009-12-08 08:33:14 +01:00
Max Kellermann
5b82ffc291 include config.h in all sources
After we've been hit by Large File Support problems several times in
the past week (which only occur on 32 bit platforms, which I don't
have), this is yet another attempt to fix the issue.
2009-11-12 09:17:03 +01:00
Max Kellermann
c953d6409d mapper, update, ...: use g_build_filename(), G_DIR_SEPARATOR, ...
Try to be as portable as possible, use GLib path name functions and
macros.
2009-10-20 21:01:55 +02:00
Max Kellermann
d897170455 playlist: no CamelCase 2009-07-14 21:28:36 +02:00
Avuton Olrich
0aee49bdf8 all: Update copyright header.
This updates the copyright header to all be the same, which is
pretty much an update of where to mail request for a copy of the GPL
and the years of the MPD project. This also puts all committers under
'The Music Player Project' umbrella. These entries should go
individually in the AUTHORS file, for consistancy.
2009-03-13 11:51:55 -07:00
Max Kellermann
6823217697 ls: moved generic URI utilities to uri.c
"ls" is a bad name for a library which parses URIs.  We'll move the
rest of the "ls" library later.
2009-02-25 16:44:06 +01:00
Max Kellermann
94685aa9bd playlist_save: added spl_save_playlist()
spl_save_playlist() is a wrapper for spl_save_queue().
2009-02-04 22:15:37 +01:00
Max Kellermann
8d3205871c playlist: renamed global "playlist" variable to "g_playlist"
Export the "g_playlist" variable, and pass it to all playlist
functions.  This way, we can split playlist.c easier into separate
parts.  The code which initializes the singleton variable is moved to
playlist_global.c.
2009-02-04 18:56:41 +01:00
Max Kellermann
bdfb6c239a playlist: moved is_valid_playlist_name() to stored_playlist.c 2009-01-25 14:19:28 +01:00
Max Kellermann
98cb8f3969 playlist: moved savePlaylist() and loadPlaylsit() to playlist_save.c 2009-01-25 14:11:47 +01:00
Max Kellermann
1a59afa388 stored_playlist: moved configuration variables from playlist.c
Don't declare and export variables specific to stored playlists in
playlist.c/playlist.h.
2009-01-25 13:53:16 +01:00
Max Kellermann
5ed5aa99ac path: allocate buffer in fs_charset conversion functions
Don't use fixed static buffers.  GLib allocates a new string for us
anyway, let's just return this one instead of copying it.
2009-01-08 21:20:46 +01:00
Max Kellermann
fed719197c song: allocate the result of song_get_url() 2009-01-04 19:09:34 +01:00
Max Kellermann
17d8bdb427 playlist: use uri_has_scheme() instead of isRemoteUrl()
For internal checks (i.e. not in command.c), we need to check whether
an URI is in the databse, in the local file system or a remote URI
with a scheme.
2009-01-04 16:23:33 +01:00
Max Kellermann
daf7c3db5a mapper: allocate the result of map_directory_child_fs(), map_song_fs()
Don't use fixed stack buffers.
2009-01-02 10:48:55 +01:00
Max Kellermann
72255d580e mapper: allocate the result of map_uri_fs(), map_directory_fs()
Don't use fixed stack buffers.
2009-01-02 10:48:11 +01:00
Max Kellermann
1bd3cde062 playlist: fix stored playlist modifications with absolute paths
When save_absolute_paths_in_playlists was enabled in mpd.conf, MPD
broke all playlists when manipulated using the "playlistdelete"
command.  The reason was that map_directory_child_fs() was used, which
doesn't accept slashes in the file name.  Use the new map_uri_fs()
function instead.
2008-12-24 22:04:24 +01:00
Max Kellermann
3287726736 ls: removed isValidRemoteUtf8Url()
The function didn't do anything useful, it was just several lines
obfuscating that it was only forwarding isRemoteUrl()'s return value.
2008-12-16 21:15:20 +01:00
Max Kellermann
a5f8d4386c update: check return values
Nearly all mapper functions can fail and will then return NULL.  Add
checks to all callers.
2008-10-31 16:47:21 +01:00
Max Kellermann
4f807b3aaa stored_playlist: don't map files outside the database
Don't attempt to map paths which are already absolute with
map_song_fs(): check with song_in_database() instead of
song_is_file().
2008-10-23 09:54:42 +02:00
Max Kellermann
da1c0cd6d7 playlist: don't use uninitialized local variable (typo)
Instead of the uninitialized local variable "s", I should have used
"uri".
2008-10-14 17:23:24 +02:00
Max Kellermann
5b71d5f6f7 mapper: new song-to-filesystem mapper library
The mapper library maps directory and song objects to file system
paths.  With this central library, the code mixture in path.c should
be cleaned up, and we will be able to add neat features like aliasing.
2008-10-14 11:10:49 +02:00
Max Kellermann
a52a9fc1fc playlist: moved code to playlist_save.c
playlist_print_song() and playlist_print_uri() handle charset
conversion and (optional) music directory prefixing.
2008-10-14 11:10:47 +02:00