<commit_before>export function checkStatus(response) {
  if (!response.ok) {   // (response.status < 200 || response.status > 300)
    const error = new Error(response.statusText);
    error.response = response;
    throw error;
  }
  return response;
}

export function parseJSON(response) {
  return response.json();
}

export function getAlbumArtUrlForTrack(track) {
  if (track.album.images[0]) {
    return track.album.images[0].url;
  }

  return 'http://img.jch254.com/Blank.jpg';
}

export const ID_TOKEN = 'id_token';
export const ID_TOKEN_EXPIRY = 'id_token_expiry';

export function setStoredAuthData(idToken, idTokenExpiry) {
  localStorage.setItem(ID_TOKEN, idToken);
  localStorage.setItem(ID_TOKEN_EXPIRY, idTokenExpiry);
}

export function removeStoredAuthData() {
  localStorage.removeItem(ID_TOKEN);
  localStorage.removeItem(ID_TOKEN_EXPIRY);<commit_msg>Try to load smaller album art first to improve performance<commit_after>export function checkStatus(response) {
  if (!response.ok) {   // (response.status < 200 || response.status > 300)
    const error = new Error(response.statusText);
    error.response = response;
    throw error;
  }
  return response;
}

export function parseJSON(response) {
  return response.json();
}

export function getAlbumArtUrlForTrack(track) {
  if (track.album.images[1]) {
    return track.album.images[1].url;
  } else if (track.album.images[0]) {
    return track.album.images[0].url;
  }

  return 'http://img.jch254.com/Blank.jpg';
}

export const ID_TOKEN = 'id_token';
export const ID_TOKEN_EXPIRY = 'id_token_expiry';

export function setStoredAuthData(idToken, idTokenExpiry) {
  localStorage.setItem(ID_TOKEN, idToken);
  localStorage.setItem(ID_TOKEN_EXPIRY, idTokenExpiry);
}

export function removeStoredAuthData() {
  localStorage.removeItem(ID_TOKEN);
  localStorage.removeItem(ID_TOKEN_EXPIRY);
{'fraction_non_alphanumeric': 0.11783610069630424, 'fraction_numerical': 0.012854847348687734, 'mean_word_length': 4.949044585987261, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6906690', 'n_tokens_mistral': 644, 'n_tokens_neox': 627, 'n_words': 121}