예제 #1
0
        private bool playableMimeType()
        {
            String episodeMimeType = EpisodeFileMimeType;

            if (episodeMimeType == "-ERROR-")
            {
                return(false);
            }

            bool playable = PodcastPlaybackManager.isAudioPodcast(this);

            if (!playable)
            {
                switch (episodeMimeType)
                {
                case "video/mp4":
                case "video/x-mp4":
                case "video/x-mpeg":
                case "video/x-m4v":
                case "video/m4v":
                case "video/mpeg":
                case "video/vnd.objectvideo":
                    playable = true;
                    break;
                }
            }

            return(playable);
        }
예제 #2
0
        private int partiallyPlayedEpisodesCount(int subscriptionId)
        {
            using (var db = new PodcastSqlModel())
            {
                try
                {
                    var query = from episode in db.Episodes
                                where (episode.PodcastId == subscriptionId &&
                                       episode.EpisodePlayState != PodcastEpisodeModel.EpisodePlayStateEnum.Listened &&
                                       episode.SavedPlayPos > 0)
                                select episode;

                    return(query.AsEnumerable().Where(episode => PodcastPlaybackManager.isAudioPodcast(episode)).Count());

                    // return query.Count();
                }
                catch (Exception)
                {
                    // Something happened.
                    return(0);
                }
            }
        }
예제 #3
0
        private int unplayedEpisodesCount(int subscriptionId)
        {
            using (var db = new PodcastSqlModel())
            {
                try
                {
                    var query = from episode in db.Episodes
                                where (episode.PodcastId == subscriptionId &&
                                       episode.EpisodePlayState == PodcastEpisodeModel.EpisodePlayStateEnum.Downloaded &&
                                       episode.SavedPlayPos == 0)
                                select episode;

                    return(query.AsEnumerable().Where(episode => PodcastPlaybackManager.isAudioPodcast(episode)).Count());

                    // int count = query.Count();
                    // return count;
                }
                catch (Exception)
                {
                    return(0);
                }
            }
        }