Make ini not case sensitive

This commit is contained in:
Jordan Eldredge 2017-11-15 20:35:29 -08:00
parent 7a74d612c0
commit b10dffe454
5 changed files with 22 additions and 22 deletions

View file

@ -17,8 +17,8 @@ const Track = props => {
ctrlClickTrack
} = props;
const style = {
backgroundColor: selected ? skinPlaylistStyle.SelectedBG : null,
color: current ? skinPlaylistStyle.Current : null
backgroundColor: selected ? skinPlaylistStyle.selectedbg : null,
color: current ? skinPlaylistStyle.current : null
};
return (
<div

View file

@ -42,9 +42,9 @@ const PlaylistWindow = props => {
} = props;
const style = {
color: skinPlaylistStyle.Normal,
backgroundColor: skinPlaylistStyle.NormalBG,
fontFamily: `${skinPlaylistStyle.Font}, Arial, sans-serif`,
color: skinPlaylistStyle.normal,
backgroundColor: skinPlaylistStyle.normalbg,
fontFamily: `${skinPlaylistStyle.font}, Arial, sans-serif`,
height: `${MIN_WINDOW_HEIGHT +
playlistSize[1] * PLAYLIST_RESIZE_SEGMENT_HEIGHT}px`,
width: `${MIN_WINDOW_WIDTH +

View file

@ -148,7 +148,7 @@ const defaultPlaylistStyle = {
async function genPlaylistStyle(zip) {
const pleditContent = await genFileFromZip(zip, "PLEDIT", "txt", "text");
return pleditContent ? parseIni(pleditContent).Text : defaultPlaylistStyle;
return pleditContent ? parseIni(pleditContent).text : defaultPlaylistStyle;
}
async function genColors(zip) {

View file

@ -46,9 +46,9 @@ export const parseIni = text => {
let section, match;
return text.split(/[\r\n]+/g).reduce((data, line) => {
if ((match = line.match(PROPERTY_REGEX)) && section != null) {
data[section][match[1]] = match[2];
data[section][match[1].toLowerCase()] = match[2];
} else if ((match = line.match(SECTION_REGEX))) {
section = match[1];
section = match[1].toLowerCase();
data[section] = {};
}
return data;

View file

@ -102,12 +102,12 @@ describe("parseIni", () => {
const pledit = fixture("PLEDIT.TXT");
const actual = parseIni(pledit);
const expected = {
Text: {
Normal: "#00FF00",
Current: "#FFFFFF",
NormalBG: "#000000",
SelectedBG: "#0000FF",
Font: "Arial"
text: {
normal: "#00FF00",
current: "#FFFFFF",
normalbg: "#000000",
selectedbg: "#0000FF",
font: "Arial"
}
};
expect(actual).toEqual(expected);
@ -117,14 +117,14 @@ describe("parseIni", () => {
const pledit = fixture("PLEDIT_TOPAZ.TXT");
const actual = parseIni(pledit);
const expected = {
Text: {
Normal: "#319593",
Current: "#89D8D1",
NormalBG: "#000000",
SelectedBG: "#2B4242",
Font: "Arial",
mbBG: "#000000",
mbFG: "#89D8D1"
text: {
normal: "#319593",
current: "#89D8D1",
normalbg: "#000000",
selectedbg: "#2B4242",
font: "Arial",
mbbg: "#000000",
mbfg: "#89D8D1"
}
};
expect(actual).toEqual(expected);