<commit_before>package net.x4a42.volksempfaenger.data;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;
import android.util.Log;

public class DatabaseHelper extends SQLiteOpenHelper {

	private static final String DB_NAME = "podcast.db";
	private static final int DB_VERSION = 1;

	public static class Podcast {

		public static final String _TABLE = "podcast";
		public static final String ID = BaseColumns._ID;
		public static final String TITLE = "title";
		public static final String DESCRIPTION = "description";
		public static final String URL = "url";
		public static final String WEBSITE = "website";

		private static String createSql() {
			StringBuilder sql = new StringBuilder();
			sql.append("CREATE TABLE \"podcast\" (\n");
			sql.append("  \"_id\" INTEGER PRIMARY KEY AUTOINCREMENT,\n");
			sql.append("  \"title\" TEXT,\n");
			sql.append("  \"description\" TEXT,\n");
			sql.append("  \"url\" TEXT UNIQUE,\n");
			sql.append("  \"website\" TEXT\n");
			sql.append(")");
			return sql.toString();
		}

	}

	public static class Episode {

		public static final String _TABLE = "episode";
		public static final String ID = BaseColumns._ID;
		public static final String ITEM_ID = "item_id";
		public static final String PODCAST = "podcast_id";
		public static final String TITLE = "title";
		public static final String DATE = "date";
		public static final String URL = "url";
		public static final String DESCRIPTION = "description";
		public static final String STATE = "state";
		public static final String ENCLOSURE = "enclosure_id";

		public static final int STATE_NEW = 0;
		public static final int STATE_DOWNLOAD_QUEUED = 1;
		public static final int STATE_DOWNLOADING = 2;
		public static final int STATE_DOWNLOADED = 3;
		public static final int STATE_LISTEN_QUEUED = 4;
		public static final int STATE_LISTENING = 5;
		public static final int STATE_LISTENED = 6;
		public static final int STATE_DELETED = 7;

		private static String createSql() {
			StringBuilder sql = new StringBuilder();
			sql.append("CREATE TABLE \"episode\" (\n");
			sql.append("  \"_id\" INTEGER PRIMARY KEY AUTOINCREMENT,\n");
			sql.append("  \"item_id\" TEXT,\n");
			sql.append("  \"podcast_id\" INTEGER REFERENCES \"podcast\" (\"_id\") ON DELETE CASCADE,\n");
			sql.append("  \"title\" TEXT,\n");
			sql.append("  \"date\" INTEGER,\n");
			sql.append("  \"url\" TEXT,\n");
			sql.append("  \"description\" TEXT,\n");
			sql.append("  \"state\" INTEGER,\n");
			sql.append("  \"enclosure_id\" INTEGER REFERENCES \"enclosure\" (\"_id\"),\n");
			sql.append("  UNIQUE (\"podcast_id\", \"item_id\")\n");
			sql.append(")");
			return sql.toString();
		}

	}

	public static class Enclosure {

		public static final String _TABLE = "enclosure";
		public static final String ID = BaseColumns._ID;
		public static final String EPISODE = "episode_id";
		public static final String TITLE = "title";
		public static final String URL = "url";
		public static final String MIME = "mime";
		public static final String FILE = "file";
		public static final String SIZE = "size";
		public static final String DOWNLOAD_ID = "download_id";
		public static final String DURATION_TOTAL = "duration_total";
		public static final String DURATION_LISTENED = "duration_listened";

		private static String createSql() {
			StringBuilder sql = new StringBuilder();
			sql.append("CREATE TABLE \"enclosure\" (\n");<commit_msg>DatabaseHelper: Removed useless enclosure/episode states. BROKEN AT THE MOMENT.<commit_after>package net.x4a42.volksempfaenger.data;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;
import android.util.Log;

public class DatabaseHelper extends SQLiteOpenHelper {

	private static final String DB_NAME = "podcast.db";
	private static final int DB_VERSION = 1;

	public static class Podcast {

		public static final String _TABLE = "podcast";
		public static final String ID = BaseColumns._ID;
		public static final String TITLE = "title";
		public static final String DESCRIPTION = "description";
		public static final String URL = "url";
		public static final String WEBSITE = "website";

		private static String createSql() {
			StringBuilder sql = new StringBuilder();
			sql.append("CREATE TABLE \"podcast\" (\n");
			sql.append("  \"_id\" INTEGER PRIMARY KEY AUTOINCREMENT,\n");
			sql.append("  \"title\" TEXT,\n");
			sql.append("  \"description\" TEXT,\n");
			sql.append("  \"url\" TEXT UNIQUE,\n");
			sql.append("  \"website\" TEXT\n");
			sql.append(")");
			return sql.toString();
		}

	}

	public static class Episode {

		public static final String _TABLE = "episode";
		public static final String ID = BaseColumns._ID;
		public static final String ITEM_ID = "item_id";
		public static final String PODCAST = "podcast_id";
		public static final String TITLE = "title";
		public static final String DATE = "date";
		public static final String URL = "url";
		public static final String DESCRIPTION = "description";
		public static final String STATE = "state";
		public static final String ENCLOSURE = "enclosure_id";
		
		public static final int STATE_NEW = 0;
		public static final int STATE_DOWNLOADING = 1;
		public static final int STATE_READY = 2;
		public static final int STATE_LISTENING = 3;
		public static final int STATE_LISTENED = 4;

		private static String createSql() {
			StringBuilder sql = new StringBuilder();
			sql.append("CREATE TABLE \"episode\" (\n");
			sql.append("  \"_id\" INTEGER PRIMARY KEY AUTOINCREMENT,\n");
			sql.append("  \"item_id\" TEXT,\n");
			sql.append("  \"podcast_id\" INTEGER REFERENCES \"podcast\" (\"_id\") ON DELETE CASCADE,\n");
			sql.append("  \"title\" TEXT,\n");
			sql.append("  \"date\" INTEGER,\n");
			sql.append("  \"url\" TEXT,\n");
			sql.append("  \"description\" TEXT,\n");
			sql.append("  \"state\" INTEGER DEFAULT 0,\n");
			sql.append("  \"enclosure_id\" INTEGER REFERENCES \"enclosure\" (\"_id\"),\n");
			sql.append("  UNIQUE (\"podcast_id\", \"item_id\")\n");
			sql.append(")");
			return sql.toString();
		}

	}

	public static class Enclosure {

		public static final String _TABLE = "enclosure";
		public static final String ID = BaseColumns._ID;
		public static final String EPISODE = "episode_id";
		public static final String TITLE = "title";
		public static final String URL = "url";
		public static final String MIME = "mime";
		public static final String FILE = "file";
		public static final String SIZE = "size";
		public static final String DOWNLOAD_ID = "download_id";
		public static final String DURATION_TOTAL = "duration_total";
		public static final String DURATION_LISTENED = "duration_listened";

		private static String createSql() {
			StringBuilder sql = new StringBuilder();
			sql.append("CREATE TABLE \"enclosure\" (\n");
{'fraction_non_alphanumeric': 0.12715269804822044, 'fraction_numerical': 0.0031572904707233064, 'mean_word_length': 4.002871500358937, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7146578', 'n_tokens_mistral': 2362, 'n_tokens_neox': 2050, 'n_words': 701}