Skip to content

Ошибка после ручной правки истории прослушиваний #45

Discussion options

You must be logged in to vote

Запустите следующую функцию один раз. Потом ее можно удалить. Для ручного добавления треков используйте appendTracks.

function patchHistory() {
  let tracks = Cache.read('LastfmRecentTracks');
  tracks.forEach((t) => {
    if (t.hasOwnProperty('added_at')) {
      t.played_at = t.added_at;
      delete t.added_at;
    } else if (!t.hasOwnProperty('played_at')) {
      t.played_at = DEFAULT_DATE;
    }
  });
  Cache.write('LastfmRecentTracks', tracks);
}

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@ilyanikolaich
Comment options

Comment options

You must be logged in to vote
1 reply
@ilyanikolaich
Comment options

Answer selected by ilyanikolaich
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants