Skip to content

Commit

Permalink
Formatting code
Browse files Browse the repository at this point in the history
  • Loading branch information
josdem committed Jan 4, 2025
1 parent 86e32ca commit 6514558
Show file tree
Hide file tree
Showing 209 changed files with 12,475 additions and 12,042 deletions.
132 changes: 66 additions & 66 deletions src/main/java/com/josdem/jmetadata/ApplicationConstants.java
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
/*
Copyright 2024 Jose Morales contact@josdem.io
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.josdem.jmetadata;

public interface ApplicationConstants {
String LOGIN_FAIL = "Login fail";
String LOGGED_AS = "Logged as : ";
String DONE = "Done";
String OPEN_ERROR = "Error on importing Music";
String WORKING = "Working";
int ARTIST_COLUMN = 0;
int TITLE_COLUMN = 1;
int ALBUM_COLUMN = 2;
int GENRE_COLUMN = 3;
int YEAR_COLUMN = 4;
int TRACK_NUMBER_COLUMN = 5;
int TOTAL_TRACKS_NUMBER_COLUMN = 6;
int CD_NUMBER_COLUMN = 7;
int TOTAL_CDS_NUMBER_COLUMN = 8;
int STATUS_COLUMN = 9;
int WIDTH = 1024;
int HEIGHT = 600;
String COVER_ART_FROM_FILE = "Cover Art from File";
String COVER_ART_FROM_LASTFM = "Cover Art from Lastfm";
String COVER_ART_FROM_DRAG_AND_DROP = "Cover Art from Drag & Drop";
String COVER_ART_DEFAULT = "Covert Art not found";
String APPLY = "Apply";
String EXPORT = "Export";
String NEW = "New";
String READY = "Ready";
String APPLICATION_NAME = "JMetadata";
String IMAGE_EXT = "PNG";
String FILE_EXT = "txt";
String PREFIX = "JMetadata_";
String GETTING_ALBUM = "Getting Album from Musicbrainz";
String GETTING_LAST_FM = "Getting Last.fm Metadata";
String COMPLETE_DEFAULT_VALUES = "Completing default values";
String GETTING_FORMATTER = "Formatting metadata";
String WRITING_METADATA = "Writing Metadata";
String USERNAME_LABEL = "username:";
String PASSWORD_LABEL = "password:";
int THREE_HUNDRED = 300;
String CORRUPTED_METADATA_LABEL = " has a corrupted coverArt";
String METADATA_FROM_FILE_LABEL = " title and artist metadata were extracted from file name";
String AND_ANOTHER = " and another ";
String DIRECTORY_EMPTY = "I could not find any mp3 or mp4 audio file in the directory";
String DIRECTORY_NOT_FOUND = "I could not find that directory to scan: ";
String FILE_NOT_FOUND = "I could not find this file: ";
String TOO_MUCH_FILES_LOADED = "Too much files loaded, maximum allowed: ";
String MEDIA_TYPE = "application/json";
String USER_AGENT = "JMetadata/1.1.0 (contact@josdem.io)";
}
/*
Copyright 2024 Jose Morales contact@josdem.io
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.josdem.jmetadata;

public interface ApplicationConstants {
String LOGIN_FAIL = "Login fail";
String LOGGED_AS = "Logged as : ";
String DONE = "Done";
String OPEN_ERROR = "Error on importing Music";
String WORKING = "Working";
int ARTIST_COLUMN = 0;
int TITLE_COLUMN = 1;
int ALBUM_COLUMN = 2;
int GENRE_COLUMN = 3;
int YEAR_COLUMN = 4;
int TRACK_NUMBER_COLUMN = 5;
int TOTAL_TRACKS_NUMBER_COLUMN = 6;
int CD_NUMBER_COLUMN = 7;
int TOTAL_CDS_NUMBER_COLUMN = 8;
int STATUS_COLUMN = 9;
int WIDTH = 1024;
int HEIGHT = 600;
String COVER_ART_FROM_FILE = "Cover Art from File";
String COVER_ART_FROM_LASTFM = "Cover Art from Lastfm";
String COVER_ART_FROM_DRAG_AND_DROP = "Cover Art from Drag & Drop";
String COVER_ART_DEFAULT = "Covert Art not found";
String APPLY = "Apply";
String EXPORT = "Export";
String NEW = "New";
String READY = "Ready";
String APPLICATION_NAME = "JMetadata";
String IMAGE_EXT = "PNG";
String FILE_EXT = "txt";
String PREFIX = "JMetadata_";
String GETTING_ALBUM = "Getting Album from Musicbrainz";
String GETTING_LAST_FM = "Getting Last.fm Metadata";
String COMPLETE_DEFAULT_VALUES = "Completing default values";
String GETTING_FORMATTER = "Formatting metadata";
String WRITING_METADATA = "Writing Metadata";
String USERNAME_LABEL = "username:";
String PASSWORD_LABEL = "password:";
int THREE_HUNDRED = 300;
String CORRUPTED_METADATA_LABEL = " has a corrupted coverArt";
String METADATA_FROM_FILE_LABEL = " title and artist metadata were extracted from file name";
String AND_ANOTHER = " and another ";
String DIRECTORY_EMPTY = "I could not find any mp3 or mp4 audio file in the directory";
String DIRECTORY_NOT_FOUND = "I could not find that directory to scan: ";
String FILE_NOT_FOUND = "I could not find this file: ";
String TOO_MUCH_FILES_LOADED = "Too much files loaded, maximum allowed: ";
String MEDIA_TYPE = "application/json";
String USER_AGENT = "JMetadata/1.1.0 (contact@josdem.io)";
}
4 changes: 2 additions & 2 deletions src/main/java/com/josdem/jmetadata/Auth.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
package com.josdem.jmetadata;

public interface Auth {
static final String KEY = "LASTFM_API_KEY";
static final String SECRET = "LASTFM_API_SECRET";
static final String KEY = "LASTFM_API_KEY";
static final String SECRET = "LASTFM_API_SECRET";
}
113 changes: 54 additions & 59 deletions src/main/java/com/josdem/jmetadata/Launcher.java
Original file line number Diff line number Diff line change
@@ -1,59 +1,54 @@
/*
Copyright 2013 Jose Luis De la Cruz Morales joseluis.delacruz@gmail.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.josdem.jmetadata;

import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

import com.josdem.jmetadata.helper.ApplicationContextSingleton;
import org.asmatron.messengine.engines.DefaultEngine;
import org.springframework.context.ConfigurableApplicationContext;

import lombok.extern.slf4j.Slf4j;

@Slf4j


/**
* @author josdem (joseluis.delacruz@gmail.com)
* @understands A class who knows how to launch ALL the process
*/

public class Launcher {
private static final String HIPECOTECH_LNF = "com.josdem.jmetadata.laf.HipecotechLookAndFeel";


public Launcher(ConfigurableApplicationContext applicationContext) {
DefaultEngine defaultEngine = applicationContext.getBean(DefaultEngine.class);
defaultEngine.start();
}

public static void main(String[] args) {
try {
UIManager.setLookAndFeel(HIPECOTECH_LNF);
} catch (ClassNotFoundException e) {
log.error(e.getMessage(), e);
} catch (InstantiationException e) {
log.error(e.getMessage(), e);
} catch (IllegalAccessException e) {
log.error(e.getMessage(), e);
} catch (UnsupportedLookAndFeelException e) {
log.error(e.getMessage(), e);
}
new Launcher(ApplicationContextSingleton.getApplicationContext());
}
}
/*
Copyright 2013 Jose Luis De la Cruz Morales joseluis.delacruz@gmail.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.josdem.jmetadata;

import com.josdem.jmetadata.helper.ApplicationContextSingleton;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import lombok.extern.slf4j.Slf4j;
import org.asmatron.messengine.engines.DefaultEngine;
import org.springframework.context.ConfigurableApplicationContext;

@Slf4j

/**
* @author josdem (joseluis.delacruz@gmail.com)
* @understands A class who knows how to launch ALL the process
*/
public class Launcher {
private static final String HIPECOTECH_LNF = "com.josdem.jmetadata.laf.HipecotechLookAndFeel";

public Launcher(ConfigurableApplicationContext applicationContext) {
DefaultEngine defaultEngine = applicationContext.getBean(DefaultEngine.class);
defaultEngine.start();
}

public static void main(String[] args) {
try {
UIManager.setLookAndFeel(HIPECOTECH_LNF);
} catch (ClassNotFoundException e) {
log.error(e.getMessage(), e);
} catch (InstantiationException e) {
log.error(e.getMessage(), e);
} catch (IllegalAccessException e) {
log.error(e.getMessage(), e);
} catch (UnsupportedLookAndFeelException e) {
log.error(e.getMessage(), e);
}
new Launcher(ApplicationContextSingleton.getApplicationContext());
}
}
52 changes: 31 additions & 21 deletions src/main/java/com/josdem/jmetadata/action/ActionResult.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,31 @@
/*
Copyright 2013 Jose Luis De la Cruz Morales joseluis.delacruz@gmail.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.josdem.jmetadata.action;

public enum ActionResult {
Ready, New, Error, Not_Scrobbleable, Sessionless, NotFound, Updated, NotLogged, Sent, Exported, Complete
}
/*
Copyright 2013 Jose Luis De la Cruz Morales joseluis.delacruz@gmail.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package com.josdem.jmetadata.action;

public enum ActionResult {
Ready,
New,
Error,
Not_Scrobbleable,
Sessionless,
NotFound,
Updated,
NotLogged,
Sent,
Exported,
Complete
}
Loading

0 comments on commit 6514558

Please sign in to comment.