LocalMovieMessage.java 4.8 KB
package com.gimi.common.cinema.model;

import android.text.TextUtils;
import com.xgimi.gimicinema.activity.CinemaConfig;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * Created by 李攀 on 2015/4/29
 */
public class LocalMovieMessage implements Serializable {
    private int id;
    private String movieName;
    private String posterPath;
    private String playPath;
    private String namePinyin;
    private String md5;
    private String type;
    private String doubanId;
    private String classDescribe;
    private String movieLength;
    private double doubanRating;
    private String lastPlayTime;
    private String screenTime;
    private int count;
    private String dlTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getMovieName() {
        return movieName;
    }

    public void setMovieName(String movieName) {
        this.movieName = movieName;
    }

    public String getPosterPath() {
        if (TextUtils.isEmpty(posterPath) || posterPath.startsWith("/mnt/samba/")|| posterPath.startsWith("/Uploads/pic/")
                || posterPath.startsWith("/mnt/usb/")) {
            return posterPath;
        }
        return CinemaConfig.BASIC_ROOT + posterPath;
    }

    public void setPosterPath(String posterPath) {
        if (TextUtils.isEmpty(posterPath)) {
            this.posterPath = null;
        } else {
            this.posterPath = posterPath.replace(CinemaConfig.BASIC_ROOT, "");
        }
    }

    public String getPlayPath() {
        if (TextUtils.isEmpty(playPath) || playPath.startsWith("/mnt/samba/")|| playPath.startsWith("/mnt/usb/")) {
            return playPath;
        }
        return CinemaConfig.BASIC_ROOT + playPath;
    }

    public void setPlayPath(String playPath) {
        if (TextUtils.isEmpty(playPath)) {
            this.playPath = null;
        } else {
            this.playPath = playPath.replace(CinemaConfig.BASIC_ROOT, "");
        }
    }

    public String getNamePinyin() {
        return namePinyin;
    }

    public void setNamePinyin(String namePinyin) {
        this.namePinyin = namePinyin;
    }

    public String getMd5() {
        return md5;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDoubanId() {
        return doubanId;
    }

    public void setDoubanId(String doubanId) {
        this.doubanId = doubanId;
    }

    public String getClassDescribe() {
        return classDescribe;
    }

    public void setClassDescribe(String classDescribe) {
        this.classDescribe = classDescribe;
    }

    public String getMovieLength() {
        return movieLength;
    }

    public void setMovieLength(String movieLength) {
        this.movieLength = movieLength;
    }

    public double getDoubanRating() {
        return doubanRating;
    }

    public void setDoubanRating(double doubanRating) {
        this.doubanRating = doubanRating;
    }

    public String getLastPlayTime() {
        return lastPlayTime;
    }

    public void setLastPlayTime(long lastPlayTime1) {
        DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(lastPlayTime1);
        String format = formatter.format(calendar.getTime());
        this.lastPlayTime = format;
    }

    public void setLastPlayTime(String lastPlayTime) {
        this.lastPlayTime = lastPlayTime;
    }

    public String getScreenTime() {
        return screenTime;
    }

    public void setScreenTime(String screenTime) {
        this.screenTime = screenTime;
    }


    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public String getDlTime() {
        return dlTime;
    }

    public void setDlTime(String dlTime) {
        this.dlTime = dlTime;
    }

    @Override
    public String toString() {
        return "LocalMovieMessage{" +
                "id=" + id +
                ", movieName='" + movieName + '\'' +
                ", posterPath='" + posterPath + '\'' +
                ", playPath='" + playPath + '\'' +
                ", namePinyin='" + namePinyin + '\'' +
                ", md5='" + md5 + '\'' +
                ", type='" + type + '\'' +
                ", doubanId='" + doubanId + '\'' +
                ", classDescribe='" + classDescribe + '\'' +
                ", movieLength='" + movieLength + '\'' +
                ", doubanRating='" + doubanRating + '\'' +
                ", lastPlayTime=" + lastPlayTime +
                ", screenTime=" + screenTime +
                '}';
    }
}