Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: 엑셀 노래 제목 데이터가 숫자로 구성된 상황을 처리한다. #435

Merged
merged 2 commits into from
Sep 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.List;
import java.util.Optional;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.DataFormatter;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
Expand All @@ -24,6 +25,7 @@
@Component
public class SongDataExcelReader {

private static final DataFormatter stringDataFormatter = new DataFormatter();
private static final int VIDEO_ID_INDEX = 1;
private static final int FIRST_PAGE_INDEX = 0;
private static final int SONG_LENGTH_INDEX = 1;
Expand Down Expand Up @@ -94,7 +96,9 @@ private Optional<Song> parseToSong(final Row currentRow) {
}

private String getString(final Iterator<Cell> iterator) {
return iterator.next().getStringCellValue().trim();
final String cellValue = stringDataFormatter.formatCellValue(iterator.next());

return cellValue.trim();
}

private int getIntegerCell(final Iterator<Cell> iterator) {
Expand Down