<commit_before>define([
	"Ember",
	"EmberData",
	"utils/platform"
], function(
	Ember,
	DS,
	platform
) {

	var get = Ember.get;
	var set = Ember.set;
	var attr = DS.attr;
	var isWin = platform.isWin;

	function defaultLangFilterValue( model ) {
		var codes = get( model, "metadata.config.language_codes" );
		return Object.keys( codes ).reduce(function( obj, key ) {
			obj[ key ] = true;
			return obj;
		}, {} );
	}

	return DS.Model.extend({
		metadata: Ember.inject.service(),

		advanced            : attr( "boolean", { defaultValue: false } ),
		livestreamer        : attr( "string",  { defaultValue: "" } ),
		livestreamer_params : attr( "string",  { defaultValue: "" } ),
		quality             : attr( "number",  { defaultValue: 0 } ),
		player              : attr( "string",  { defaultValue: "" } ),
		player_params       : attr( "string",  { defaultValue: "" } ),
		player_passthrough  : attr( "string",  { defaultValue: "http" } ),
		player_reconnect    : attr( "boolean", { defaultValue: true } ),
		player_no_close     : attr( "boolean", { defaultValue: false } ),
		gui_theme           : attr( "string",  { defaultValue: "default" } ),
		gui_integration     : attr( "number",  { defaultValue: 3 } ),
		gui_minimizetotray  : attr( "number",  { defaultValue: false } ),
		gui_minimize        : attr( "number",  { defaultValue: 0 } ),
		gui_focusrefresh    : attr( "number",  { defaultValue: 0 } ),
		gui_hidestreampopup : attr( "boolean", { defaultValue: false } ),
		gui_openchat        : attr( "boolean", { defaultValue: false } ),
		gui_twitchemotes    : attr( "boolean", { defaultValue: false } ),
		gui_homepage        : attr( "string",  { defaultValue: "/featured" } ),
		gui_layout          : attr( "string",  { defaultValue: "tile" } ),
		gui_gamevisible     : attr( "boolean", { defaultValue: false } ),
		gui_flagsvisible    : attr( "boolean", { defaultValue: false } ),
		gui_filterstreams   : attr( "boolean", { defaultValue: false } ),
		gui_langfilter      : attr( "",        { defaultValue: defaultLangFilterValue } ),
		gui_streamclick_mod : attr( "number",  { defaultValue: 4 } ),
		gui_streamclick_mid : attr( "number",  { defaultValue: 2 } ),
		notify_enabled      : attr( "boolean", { defaultValue: true } ),
		notify_all          : attr( "boolean", { defaultValue: true } ),
		notify_grouping     : attr( "boolean", { defaultValue: true } ),
		notify_click        : attr( "number",  { defaultValue: 1 } ),
		notify_click_group  : attr( "number",  { defaultValue: 1 } ),
		notify_badgelabel   : attr( "boolean", { defaultValue: true } ),
		notify_shortcut     : attr( "boolean", { defaultValue: true } ),
		hls_live_edge       : attr( "number",  { defaultValue: 3, minValue: 1, maxValue: 10 } ),
		hls_segment_threads : attr( "number",  { defaultValue: 1, minValue: 1, maxValue: 10 } ),
		chat_method         : attr( "string",  { defaultValue: "default" } ),
		chat_command        : attr( "string",  { defaultValue: "" } ),


		// correct old value
		gui_minimize_observer: function() {
			if ( isNaN( get( this, "gui_minimize" ) ) ) {
				set( this, "gui_minimize", 0 );
			}
		}.observes( "gui_minimize" ),

		isVisibleInTaskbar: function() {
			return ( get( this, "gui_integration" ) & 1 ) > 0;
		}.property( "gui_integration" ),

		isVisibleInTray: function() {
			return ( get( this, "gui_integration" ) & 2 ) > 0;
		}.property( "gui_integration" )

	}).reopenClass({

		toString: function() { return "Settings"; },

		qualities: [
			{ id: 0, label: "Source", quality: "source,best" },
			{ id: 1, label: "High",   quality: "high,mobile_high,best" },
			{ id: 2, label: "Medium", quality: "medium,mobile_medium,worst" },
			{ id: 3, label: "Low",    quality: "low,mobile_mobile,worst" }
		],

		passthrough: [
			{ value: "http", label: "http" },
			{ value: "rtmp", label: "rtmp" },
			{ value: "hls",  label: "hls" }
		],

		// bitwise IDs: both & 1 && both & 2
		integration: [
			{ id: 3, label: "Both" },
			{ id: 1, label: "Taskbar" },
			{ id: 2, label: "Tray" }
		],

		minimize: [
			{ id: 0, label: "Do nothing" },
			{ id: 1, label: "Minimize" },
			{ id: 2, label: "Move to tray" }
		],

		gui_focusrefresh: [
			{ value:      0, label: "Don't refresh" },
			{ value:  60000, label: "After one minute" },
			{ value: 120000, label: "After two minutes" },
			{ value: 300000, label: "After five minutes" }
		],

		notify_all: [<commit_msg>Include `audio` stream quality. Resolve #195<commit_after>define([
	"Ember",
	"EmberData",
	"utils/platform"
], function(
	Ember,
	DS,
	platform
) {

	var get = Ember.get;
	var set = Ember.set;
	var attr = DS.attr;
	var isWin = platform.isWin;

	function defaultLangFilterValue( model ) {
		var codes = get( model, "metadata.config.language_codes" );
		return Object.keys( codes ).reduce(function( obj, key ) {
			obj[ key ] = true;
			return obj;
		}, {} );
	}

	return DS.Model.extend({
		metadata: Ember.inject.service(),

		advanced            : attr( "boolean", { defaultValue: false } ),
		livestreamer        : attr( "string",  { defaultValue: "" } ),
		livestreamer_params : attr( "string",  { defaultValue: "" } ),
		quality             : attr( "number",  { defaultValue: 0 } ),
		player              : attr( "string",  { defaultValue: "" } ),
		player_params       : attr( "string",  { defaultValue: "" } ),
		player_passthrough  : attr( "string",  { defaultValue: "http" } ),
		player_reconnect    : attr( "boolean", { defaultValue: true } ),
		player_no_close     : attr( "boolean", { defaultValue: false } ),
		gui_theme           : attr( "string",  { defaultValue: "default" } ),
		gui_integration     : attr( "number",  { defaultValue: 3 } ),
		gui_minimizetotray  : attr( "number",  { defaultValue: false } ),
		gui_minimize        : attr( "number",  { defaultValue: 0 } ),
		gui_focusrefresh    : attr( "number",  { defaultValue: 0 } ),
		gui_hidestreampopup : attr( "boolean", { defaultValue: false } ),
		gui_openchat        : attr( "boolean", { defaultValue: false } ),
		gui_twitchemotes    : attr( "boolean", { defaultValue: false } ),
		gui_homepage        : attr( "string",  { defaultValue: "/featured" } ),
		gui_layout          : attr( "string",  { defaultValue: "tile" } ),
		gui_gamevisible     : attr( "boolean", { defaultValue: false } ),
		gui_flagsvisible    : attr( "boolean", { defaultValue: false } ),
		gui_filterstreams   : attr( "boolean", { defaultValue: false } ),
		gui_langfilter      : attr( "",        { defaultValue: defaultLangFilterValue } ),
		gui_streamclick_mod : attr( "number",  { defaultValue: 4 } ),
		gui_streamclick_mid : attr( "number",  { defaultValue: 2 } ),
		notify_enabled      : attr( "boolean", { defaultValue: true } ),
		notify_all          : attr( "boolean", { defaultValue: true } ),
		notify_grouping     : attr( "boolean", { defaultValue: true } ),
		notify_click        : attr( "number",  { defaultValue: 1 } ),
		notify_click_group  : attr( "number",  { defaultValue: 1 } ),
		notify_badgelabel   : attr( "boolean", { defaultValue: true } ),
		notify_shortcut     : attr( "boolean", { defaultValue: true } ),
		hls_live_edge       : attr( "number",  { defaultValue: 3, minValue: 1, maxValue: 10 } ),
		hls_segment_threads : attr( "number",  { defaultValue: 1, minValue: 1, maxValue: 10 } ),
		chat_method         : attr( "string",  { defaultValue: "default" } ),
		chat_command        : attr( "string",  { defaultValue: "" } ),


		// correct old value
		gui_minimize_observer: function() {
			if ( isNaN( get( this, "gui_minimize" ) ) ) {
				set( this, "gui_minimize", 0 );
			}
		}.observes( "gui_minimize" ),

		isVisibleInTaskbar: function() {
			return ( get( this, "gui_integration" ) & 1 ) > 0;
		}.property( "gui_integration" ),

		isVisibleInTray: function() {
			return ( get( this, "gui_integration" ) & 2 ) > 0;
		}.property( "gui_integration" )

	}).reopenClass({

		toString: function() { return "Settings"; },

		qualities: [
			{ id: 0, label: "Source",     quality: "source,best" },
			{ id: 1, label: "High",       quality: "high,mobile_high,best" },
			{ id: 2, label: "Medium",     quality: "medium,mobile_medium,worst" },
			{ id: 3, label: "Low",        quality: "low,mobile_mobile,worst" },
			{ id: 4, label: "Audio only", quality: "audio" }
		],

		passthrough: [
			{ value: "http", label: "http" },
			{ value: "rtmp", label: "rtmp" },
			{ value: "hls",  label: "hls" }
		],

		// bitwise IDs: both & 1 && both & 2
		integration: [
			{ id: 3, label: "Both" },
			{ id: 1, label: "Taskbar" },
			{ id: 2, label: "Tray" }
		],

		minimize: [
			{ id: 0, label: "Do nothing" },
			{ id: 1, label: "Minimize" },
			{ id: 2, label: "Move to tray" }
		],

		gui_focusrefresh: [
			{ value:      0, label: "Don't refresh" },
			{ value:  60000, label: "After one minute" },
			{ value: 120000, label: "After two minutes" },
			{ value: 300000, label: "After five minutes" }
		],

		notify_all: [
{'fraction_non_alphanumeric': 0.1686936936936937, 'fraction_numerical': 0.011936936936936936, 'mean_word_length': 3.0945136007376672, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7306638', 'n_tokens_mistral': 3395, 'n_tokens_neox': 3012, 'n_words': 740}