Skip to content

Commit

Permalink
remove newline from MyPageScraper CSV parser check (#1207)
Browse files Browse the repository at this point in the history
It seems there are CSVs in the wild that use \r\n instead of just \n, which can cause this to fail. Since this check is already best-effort, just drop the newline since it doesn't really matter.

Untested. Unclear if the \r\n can cause additional downstream  serverside parsing issues that will also need to be addressed.
  • Loading branch information
cg505 authored Nov 11, 2024
1 parent 38047bb commit ca275e1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React from "react";
function RecordsParseFunction(data: string) {
if (
!data.startsWith(
"music_id,music_title,music_artist,music_genre,music_levels,music_play_counts,music_scores,music_achieves\n"
"music_id,music_title,music_artist,music_genre,music_levels,music_play_counts,music_scores,music_achieves"
)
) {
throw new Error(
Expand All @@ -30,7 +30,7 @@ function RecordsParseFunction(data: string) {
function PlayerParseFunction(data: string) {
if (
!data.startsWith(
"player_name,player_level,player_rate,player_stage,player_play_count,player_play_count_versus,player_play_count_coop,player_total_rp_earned,player_total_rp_spent\n"
"player_name,player_level,player_rate,player_stage,player_play_count,player_play_count_versus,player_play_count_coop,player_total_rp_earned,player_total_rp_spent"
)
) {
throw new Error(
Expand Down

0 comments on commit ca275e1

Please sign in to comment.