001package net.filebot.web;
002
003import java.io.Serializable;
004import java.net.URL;
005import java.util.Locale;
006
007public class TheTVDBSeriesInfo extends SeriesInfo implements Serializable {
008
009        protected String slug;
010        protected String imdbId;
011        protected int season;
012        protected String overview;
013        protected String airsDayOfWeek;
014        protected String airsTime;
015        protected String poster;
016        protected long lastUpdated;
017
018        public TheTVDBSeriesInfo() {
019                // used by deserializer
020        }
021
022        public TheTVDBSeriesInfo(TheTVDBSeriesInfo other) {
023                super(other);
024                this.slug = other.slug;
025                this.imdbId = other.imdbId;
026                this.season = other.season;
027                this.overview = other.overview;
028                this.airsDayOfWeek = other.airsDayOfWeek;
029                this.airsTime = other.airsTime;
030                this.poster = other.poster;
031                this.lastUpdated = other.lastUpdated;
032        }
033
034        public TheTVDBSeriesInfo(Datasource database, Locale language, Integer id) {
035                super(database, null, language, id, TYPE_SERIES);
036        }
037
038        public String getSlug() {
039                return slug;
040        }
041
042        public void setSlug(String slug) {
043                this.slug = slug;
044        }
045
046        public String getImdbId() {
047                return imdbId;
048        }
049
050        public void setImdbId(String imdbId) {
051                this.imdbId = imdbId;
052        }
053
054        public int getSeason() {
055                return season;
056        }
057
058        public void setSeason(Integer season) {
059                this.season = season == null ? 0 : season;
060        }
061
062        public String getOverview() {
063                return overview;
064        }
065
066        public void setOverview(String overview) {
067                this.overview = overview;
068        }
069
070        public String getAirsDayOfWeek() {
071                return airsDayOfWeek;
072        }
073
074        public void setAirsDayOfWeek(String airsDayOfWeek) {
075                this.airsDayOfWeek = airsDayOfWeek;
076        }
077
078        public String getAirsTime() {
079                return airsTime;
080        }
081
082        public void setAirsTime(String airsTime) {
083                this.airsTime = airsTime;
084        }
085
086        public void setPoster(URL poster) {
087                this.poster = poster == null ? null : poster.toExternalForm();
088        }
089
090        public URL getPoster() {
091                try {
092                        return poster == null ? null : new URL(poster);
093                } catch (Exception e) {
094                        return null;
095                }
096        }
097
098        public long getLastUpdated() {
099                return lastUpdated;
100        }
101
102        public void setLastUpdated(Long lastUpdated) {
103                this.lastUpdated = lastUpdated == null ? 0 : lastUpdated;
104        }
105
106        public boolean isDaily() {
107                return "Weekdays".equalsIgnoreCase(airsDayOfWeek);
108        }
109
110        public boolean isContinuing() {
111                return "Continuing".equalsIgnoreCase(status);
112        }
113
114        @Override
115        public TheTVDBSeriesInfo clone() {
116                return new TheTVDBSeriesInfo(this);
117        }
118
119}