2 * Copyright (C) 2012 Toni Gundogdu <legatvs@gmail.com>
4 * This file is part of libquvi <http://quvi.sourceforge.net/>.
6 * This library is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU Affero General Public
8 * License as published by the Free Software Foundation, either
9 * version 3 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General
17 * Public License along with this library. If not, see
18 * <http://www.gnu.org/licenses/>.
28 #include "_quvi_playlist_s.h"
30 #include "misc/playlist.h"
32 gpointer
m_playlist_new(_quvi_t q
, const gchar
*url
)
34 _quvi_playlist_t qp
= g_new0(struct _quvi_playlist_s
, 1);
36 qp
->url
.thumbnail
= g_string_new(NULL
);
37 qp
->url
.input
= g_string_new(url
);
39 qp
->id
.playlist
= g_string_new(NULL
);
43 qp
->title
= g_string_new(NULL
);
47 void m_playlist_media_free(_quvi_playlist_media_t qpm
)
52 g_string_free(qpm
->title
, TRUE
);
55 g_string_free(qpm
->url
, TRUE
);
62 static void _playlist_media_free(gpointer p
, gpointer userdata
)
64 m_playlist_media_free(p
);
67 void m_playlist_free(_quvi_playlist_t qp
)
73 g_slist_free_full(qp
->media
, _playlist_media_free
);
75 g_slist_foreach(qp
->media
, _playlist_media_free
, NULL
);
76 g_slist_free(qp
->media
);
82 g_string_free(qp
->url
.thumbnail
, TRUE
);
83 qp
->url
.thumbnail
= NULL
;
85 g_string_free(qp
->url
.input
, TRUE
);
90 g_string_free(qp
->id
.playlist
, TRUE
);
91 qp
->id
.playlist
= NULL
;
95 g_string_free(qp
->title
, TRUE
);
102 /* vim: set ts=2 sw=2 tw=72 expandtab: */