package org.arkiwi.app.feed;

import java.util.ArrayList;

public class FeedItemFile extends FeedItem {
	@SuppressWarnings("unused")
	private static final String LOG_TAG = "FeedItemFile";
	private int aid;
	private String torrent;
	private String download;
	private String rate;
	private String size;
	private String duration;
	private String channels;
	private ArrayList<String> license;
	private String creator;
	private String tags;

	public FeedItemFile(){
		super();
		this.aid = 0;
		this.torrent = "";
		this.download = "";
		this.license = new ArrayList<String>();
		this.rate = "";
		this.size = "";
		this.duration = "";
		this.channels = "";
		this.creator = "";
		this.tags = "";
	}
	
	public int getAid() {
		return aid;
	}

	public void setAid(int aid) {
		this.aid = aid;
	}

	public String getTorrent() {
		return torrent;
	}

	public void setTorrent(String torrent) {
		this.torrent = torrent;
	}
	
	public String getDownload() {
		return download;
	}

	public void setDownload(String download) {
		this.download = download;
	}

	public String getRate() {
		return rate;
	}

	public void setRate(String rate) {
		this.rate = rate;
	}

	public String getSize() {
		return size;
	}

	public void setSize(String size) {
		this.size = size;
	}

	public String getDuration() {
		return duration;
	}

	public void setDuration(String duration) {
		this.duration = duration;
	}

	public String getChannels() {
		return channels;
	}

	public void setChannels(String channels) {
		this.channels = channels;
	}

	public ArrayList<String> getLicense() {
		return license;
	}

	//TODO: da accertarsene licenze 
	public void setLicense(String license_url) {
		
		String licenseCC = "CC - n.s.";
		if (license_url != null)
			if (! license_url.equalsIgnoreCase("n.p."))
				licenseCC=license_url;
		else
			license_url="n.p.";

		this.license.add(licenseCC);
		this.license.add(license_url);
	}
	
	public String getLicenseCC() {
		if (license.size() == 1)
			return license.get(0);
		
		return null;
	}
	
	public String getLicenseUrl() {
		if (license.size() == 2)
			return license.get(1);
		
		return null;
	}

	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	public String getTags() {
		return tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}
}
