<commit_before>/**
 * @description Takes care of every action an album can handle and execute.
 * @copyright   2015 by <NAME>
 */

album = {

	json: null,
	subjson: null

}

album.isSmartID = function(id) {

	return (id==='0' || id==='f' || id==='s' || id==='r')

}

album.getID = function() {

	let id = null

	let isID = (id) => {
		if (album.isSmartID(id)===true) return true
		return $.isNumeric(id)
	}

	// Search
	if (isID(id)===false) id = $('.album:hover, .album.active').attr('data-id')
	if (isID(id)===false) id = $('.photo:hover, .photo.active').attr('data-album-id')

	if (isID(id)===false) {
		if (photo.json)      id = photo.json.album
		else if (album.json) id = album.json.id
	}

	if (isID(id)===true) return id

	return false

}

album.getParent = function() {

	let id = album.json.id

	if (album.isSmartID(id)===true || album.json.parent==0) return ''

	return album.json.parent

}

album.load = function(albumID, refresh = false) {

	password.get(albumID, function() {

		if (refresh===false) lychee.animate('.content', 'contentZoomOut')

		let startTime = new Date().getTime()<commit_msg>Check if album.json exists<commit_after>/**
 * @description Takes care of every action an album can handle and execute.
 * @copyright   2015 by <NAME>
 */

album = {

	json: null,
	subjson: null

}

album.isSmartID = function(id) {

	return (id==='0' || id==='f' || id==='s' || id==='r')

}

album.getID = function() {

	let id = null

	let isID = (id) => {
		if (album.isSmartID(id)===true) return true
		return $.isNumeric(id)
	}

	// Search
	if (isID(id)===false) id = $('.album:hover, .album.active').attr('data-id')
	if (isID(id)===false) id = $('.photo:hover, .photo.active').attr('data-album-id')

	if (isID(id)===false) {
		if (photo.json)      id = photo.json.album
		else if (album.json) id = album.json.id
	}

	if (isID(id)===true) return id

	return false

}

album.getParent = function() {

	if (album.json==null || album.isSmartID(album.json.id)===true || album.json.parent==0) return ''

	return album.json.parent

}

album.load = function(albumID, refresh = false) {

	password.get(albumID, function() {

		if (refresh===false) lychee.animate('.content', 'contentZoomOut')

		let startTime = new Date().getTime()
{'fraction_non_alphanumeric': 0.19892713455520786, 'fraction_numerical': 0.005364327223960662, 'mean_word_length': 3.7617021276595746, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5355469', 'n_tokens_mistral': 883, 'n_tokens_neox': 825, 'n_words': 192}