File indexing completed on 2024-05-19 04:50:11

0001 /****************************************************************************************
0002  * Copyright (c) 2011 Stefan Derkits <stefan@derkits.at>                                *
0003  * Copyright (c) 2011 Christian Wagner <christian.wagner86@gmx.at>                      *
0004  * Copyright (c) 2011 Felix Winter <ixos01@gmail.com>                                   *
0005  * Copyright (c) 2011 Lucas Lira Gomes <x8lucas8x@gmail.com>                            *
0006  *                                                                                      *
0007  * This program is free software; you can redistribute it and/or modify it under        *
0008  * the terms of the GNU General Public License as published by the Free Software        *
0009  * Foundation; either version 2 of the License, or (at your option) any later           *
0010  * version.                                                                             *
0011  *                                                                                      *
0012  * This program is distributed in the hope that it will be useful, but WITHOUT ANY      *
0013  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A      *
0014  * PARTICULAR PURPOSE. See the GNU General Public License for more details.             *
0015  *                                                                                      *
0016  * You should have received a copy of the GNU General Public License along with         *
0017  * this program.  If not, see <http://www.gnu.org/licenses/>.                           *
0018  ****************************************************************************************/
0019 
0020 #define DEBUG_PREFIX "GpodderPodcastMeta"
0021 
0022 #include "GpodderPodcastMeta.h"
0023 
0024 #include "GpodderProvider.h"
0025 
0026 using namespace Podcasts;
0027 
0028 Podcasts::GpodderPodcastChannel::GpodderPodcastChannel( GpodderProvider *provider )
0029     : PodcastChannel()
0030     , m_provider( provider )
0031 {
0032 }
0033 
0034 Podcasts::GpodderPodcastChannel::GpodderPodcastChannel( GpodderProvider *provider,
0035                                                         PodcastChannelPtr channel )
0036     : PodcastChannel( channel )
0037     , m_provider( provider )
0038 {
0039 }
0040 
0041 Podcasts::GpodderPodcastChannel::GpodderPodcastChannel( GpodderProvider *provider,
0042                                                         mygpo::PodcastPtr channel )
0043     : PodcastChannel()
0044     , m_provider( provider )
0045 {
0046     setUrl( channel->url() );
0047     setWebLink( channel->website() );
0048     setImageUrl( channel->logoUrl() );
0049     setDescription( channel->description() );
0050     setTitle( channel->title() );
0051 }
0052 
0053 Playlists::PlaylistProvider *
0054 Podcasts::GpodderPodcastChannel::provider() const
0055 {
0056     return dynamic_cast<Playlists::PlaylistProvider *>( m_provider );
0057 }
0058 
0059 
0060 QUrl
0061 Podcasts::GpodderPodcastChannel::uidUrl() const
0062 {
0063     QUrl u = url();
0064     u.setScheme( QStringLiteral( "amarok-gpodder" ) );
0065     return u;
0066 }