Skip to content

Commit

Permalink
Massive Changes: Add song info, images per song, album, genre, move s…
Browse files Browse the repository at this point in the history
…liders to the left layout.
  • Loading branch information
vorlie committed Aug 24, 2024
1 parent ae3b3dd commit b35f8ff
Show file tree
Hide file tree
Showing 15 changed files with 335 additions and 225 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ __pycache__/
# Ignore List for Files
*.log
test.py
venv/
venv/
165 changes: 86 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ A feature-rich music player application with playlist management, playback contr

## Features

### TODO:
[Moved here](https://github.com/users/vorlie/projects/3/views/1)
### TODO: [Click here](https://github.com/users/vorlie/projects/3/views/1)

### Core Features

Expand Down Expand Up @@ -67,6 +66,7 @@ A feature-rich music player application with playlist management, playback contr
- **Playlists and Songs Display:**
- **Playlist List:** Show available playlists and their song counts.
- **Song List:** Display the list of songs in the currently loaded playlist.
- **Song information**: For displaying the currently playing song's artist(s), title, album and genre.

- **Controls and Layouts:**
- **Control Buttons:** Various buttons for playback control, playlist management, and external actions.
Expand All @@ -90,6 +90,89 @@ A feature-rich music player application with playlist management, playback contr
- **Console Logging:** Output logs to the console.
- **File Logging:** Save logs to a rotating file for persistent records.

## Playlist Maker

The `PlaylistMaker` class provides a user-friendly interface for creating and managing playlists. It allows users to select folders containing songs, add songs manually, and save playlists in JSON format.

### Features

- **Select Folder**: Automatically populate the playlist with songs from a selected folder.
- **Add Songs Manually**: Enter song details manually including artist, title, YouTube ID, and song path.
- **Save Playlist**: Save the created playlist in JSON format.
- **Open Existing Playlist**: Load and edit an existing playlist.
- **Edit Songs**: Double-click on a song entry to edit its details.
- **Delete Songs**: Select a song and press the Delete key to remove it.

### How to Use

1. **Select Folder**:
- Click on the "Select Folder" button to choose a folder containing MP3 files.
- The application will automatically process the folder and add all MP3 files matching the naming pattern to the playlist.

2. **Add Songs Manually**:
- Fill in the "Artist", "Title", "YouTube ID" (optional), and "Song Path" fields.
- Click the "Add Song" button to add the song to the playlist.

3. **Save Playlist**:
- Enter a name for the playlist in the "Enter playlist name" field.
- Add a playlist image if you want to. It's optional after all.
- Click the "Save Playlist" button to save the playlist as a JSON file.

4. **Open Existing Playlist**:
- Click the "Open Existing Playlist" button to load a playlist.
- Select the JSON file of the playlist you want to open.

5. **Edit and Delete Songs**:
- To edit a song, double-click on the corresponding cell in the table.
- To delete a song, select the row and press the Delete key.

### Naming Scheme

For automatic recognition, the song files in the selected folder should follow this naming scheme:
- **Artist**: The name of the artist.
- **Title**: The title of the song.
- **YouTube ID**: (Optional) The YouTube ID for the song.
```
Artist - Title [YouTube ID].mp3
```
**Example(s)**:
```
Artist - Title [dQw4w9WgXcQ].mp3
Artist (feat. Artist) - Title (Bass Boosted) [dQw4w9WgXcQ].mp3
```
### Example playlist json result
```json
{
"playlist_name": "default",
"playlist_large_image_key":"https://i.pinimg.com/236x/42/43/03/424303bef006eb35803ae00505248d7a.jpg",
"song_count": 2,
"songs": [
{
"artist": "Artist 1",
"title": "Title 1",
"youtube_id": "dQw4w9WgXcQ",
"path": "C:\\Users\\USER\\Music\\FOLDER\\Artist 1 - Title 1 [dQw4w9WgXcQ].mp3",
"playlist": "default",
"album": "Album 1",
"genre": "Genre 2",
"picture_path": "C:\\Users\\USER\\Music\\FOLDER\\picture.jpg"
},
{
"artist": "Artist 2",
"title": "Title 2",
"youtube_id": "dQw4w9WgXcQ",
"path": "C:\\Users\\USER\\Music\\FOLDER\\Artist 2 - Title 2 [dQw4w9WgXcQ].mp3",
"playlist": "default",
"album": "Album 2",
"genre": "Genre 2",
"picture_path": "C:\\Users\\USER\\Music\\FOLDER\\picture.jpg"
}
]
}
```

## Installation

1. **Clone the repository:**
Expand Down Expand Up @@ -158,6 +241,7 @@ A feature-rich music player application with playlist management, playback contr
icon=['icon.ico'],
)
```

## Usage

1. **Run the application:**
Expand Down Expand Up @@ -219,83 +303,6 @@ A feature-rich music player application with playlist management, playback contr
- In `musicPlayer.py` there are commented logging configurations. Uncomment them to use them.
- Logs are written to `combined_app.log` for application and discord logs.

## Playlist Maker

The `PlaylistMaker` class provides a user-friendly interface for creating and managing playlists. It allows users to select folders containing songs, add songs manually, and save playlists in JSON format.

### Features

- **Select Folder**: Automatically populate the playlist with songs from a selected folder.
- **Add Songs Manually**: Enter song details manually including artist, title, YouTube ID, and song path.
- **Save Playlist**: Save the created playlist in JSON format.
- **Open Existing Playlist**: Load and edit an existing playlist.
- **Edit Songs**: Double-click on a song entry to edit its details.
- **Delete Songs**: Select a song and press the Delete key to remove it.

### How to Use

1. **Select Folder**:
- Click on the "Select Folder" button to choose a folder containing MP3 files.
- The application will automatically process the folder and add all MP3 files matching the naming pattern to the playlist.

2. **Add Songs Manually**:
- Fill in the "Artist", "Title", "YouTube ID" (optional), and "Song Path" fields.
- Click the "Add Song" button to add the song to the playlist.

3. **Save Playlist**:
- Enter a name for the playlist in the "Enter playlist name" field.
- Add a playlist image if you want to. It's optional after all.
- Click the "Save Playlist" button to save the playlist as a JSON file.
4. **Open Existing Playlist**:
- Click the "Open Existing Playlist" button to load a playlist.
- Select the JSON file of the playlist you want to open.
5. **Edit and Delete Songs**:
- To edit a song, double-click on the corresponding cell in the table.
- To delete a song, select the row and press the Delete key.
### Naming Scheme
For automatic recognition, the song files in the selected folder should follow this naming scheme:
- **Artist**: The name of the artist.
- **Title**: The title of the song.
- **YouTube ID**: (Optional) The YouTube ID for the song.
```
Artist - Title [YouTube ID].mp3
```
**Example(s)**:
```
Artist - Title [dQw4w9WgXcQ].mp3
Artist (feat. Artist) - Title (Bass Boosted) [dQw4w9WgXcQ].mp3
```
### Example playlist json result
```json
{
"playlist_name": "name_test",
"playlist_large_image_key":"https://i.pinimg.com/236x/42/43/03/424303bef006eb35803ae00505248d7a.jpg",
"song_count": 2,
"songs": [
{
"artist": "Artist 1",
"title": "Title 1",
"youtube_id": "dQw4w9WgXcQ",
"path": "C:\\Users\\USER\\Music\\FOLDER\\Artist 1 - Title 1 [dQw4w9WgXcQ].mp3",
"playlist": "name_test"
},
{
"artist": "Artist 2",
"title": "Title 2",
"youtube_id": "dQw4w9WgXcQ",
"path": "C:\\Users\\USER\\Music\\FOLDER\\Artist 2 - Title 2 [dQw4w9WgXcQ].mp3",
"playlist": "name_test"
}
]
}
```
## Troubleshooting

- **Ensure all dependencies are installed:**
Expand Down
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"1": "Specify the directory where your playlists are saved. You can change this path if needed.",
"2": "The default value is 'playlists'."
},
"root_playlist_folder": "playlists",
"root_playlist_folder": "C:\\Users\\karol\\Documents\\IotaPlayerFiles",
"default_playlist_comment": "Enter the name of the default playlist that will be loaded initially. You can modify this name as required.",
"default_playlist": "default",
"colorization_color_comment": {
Expand Down
2 changes: 1 addition & 1 deletion core/discordIntegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DiscordIntegration(QObject):
def __init__(self):
super().__init__()
# Load config
with open('config.json', 'r') as f:
with open('config.json', 'r', encoding='utf-8') as f:
self.config = json.load(f)
self.client_id = self.config.get('discord_client_id', '1150680286649143356')
self.large_image_key = self.config.get('large_image_key', 'default_image')
Expand Down
Loading

0 comments on commit b35f8ff

Please sign in to comment.