Skip to content

Commit 5634344

Browse files
committed
[#154] fix: rename 'mp3' to 'mp3repair'
1 parent 0e2d259 commit 5634344

40 files changed

+180
-175
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
!build/version.txt
2222

2323
# files created during the build process
24-
cmd/mp3/resource.syso
25-
cmd/mp3/versionInfo.json
24+
cmd/mp3repair/resource.syso
25+
cmd/mp3repair/versionInfo.json
2626
resource.syso
2727
versionInfo.json
2828
go.work.sum

ICON.md

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
11
# Maintenance of Windows Executable Icons
22

3-
This document describes the creation and maintenance of icons for embedding into Windows execuatables.
3+
This document describes the creation and maintenance of icons for embedding into
4+
Windows execuatables.
45

56
## Creation
67

7-
Creation of an image file is a matter of choosing a drawing program and generating a file from it. The image should be sized for the desired icon's dimensions (a square, such as 256x256). For the **mp3** icon, I used Windows Paint. I also chose to save the image as a .png (Portable Network Graphics) file.
8+
Creation of an image file is a matter of choosing a drawing program and
9+
generating a file from it. The image should be sized for the desired icon's
10+
dimensions (a square, such as 256x256). For the **mp3repair** icon, I used
11+
Windows Paint. I also chose to save the image as a .png (Portable Network
12+
Graphics) file.
813

914
## Conversion to .ico Format
1015

1116
I use [ImageMagick](https://imagemagick.org/), using this command line:
1217

1318
```bash
14-
convert mp3.png -colors 256 mp3.ico
19+
convert mp3repair.png -colors 256 mp3repair.ico
1520
```
1621

17-
Note: the command line tools are not provided by the default **ImageMagick** installer, but is an option you need to select when installing **ImageMagick**.
22+
Note: the command line tools are not provided by the default **ImageMagick**
23+
installer, but is an option you need to select when installing **ImageMagick**.
1824

1925
## Embedding in the Windows Executable
2026

@@ -26,4 +32,9 @@ Embedding the icon is a simple matter of executing the build command.
2632

2733
## Credit Where Credit is Due
2834

29-
I learned about embedding icons [here](https://hjr265.me/blog/adding-icons-for-go-built-windows-executable/). I subsequently investigated populating other executable application file properties, and automated the generation and inclusion of the icon and various additional properties into the executable image, using the [goversioninfo](https://github.com/josephspurrier/goversioninfo) package.
35+
I learned about embedding icons
36+
[here](https://hjr265.me/blog/adding-icons-for-go-built-windows-executable/). I
37+
subsequently investigated populating other executable application file
38+
properties, and automated the generation and inclusion of the icon and various
39+
additional properties into the executable image, using the
40+
[goversioninfo](https://github.com/josephspurrier/goversioninfo) package.

README.md

+64-60
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# mp3
1+
# mp3repair
22

3-
[![GoDoc Reference](https://godoc.org/github.com/majohn-r/mp3?status.svg)](https://pkg.go.dev/github.com/majohn-r/mp3)
4-
[![go.mod](https://img.shields.io/github/go-mod/go-version/majohn-r/mp3)](go.mod)
5-
[![LICENSE](https://img.shields.io/github/license/majohn-r/mp3)](LICENSE)
3+
[![GoDoc Reference](https://godoc.org/github.com/majohn-r/mp3repair?status.svg)](https://pkg.go.dev/github.com/majohn-r/mp3repair)
4+
[![go.mod](https://img.shields.io/github/go-mod/go-version/majohn-r/mp3repair)](go.mod)
5+
[![LICENSE](https://img.shields.io/github/license/majohn-r/mp3repair)](LICENSE)
66

7-
[![Release](https://img.shields.io/github/v/release/majohn-r/mp3?include_prereleases)](https://github.com/majohn-r/mp3/releases)
8-
[![Code Coverage Report](https://codecov.io/github/majohn-r/mp3/branch/main/graph/badge.svg)](https://codecov.io/github/majohn-r/mp3)
9-
[![Go Report Card](https://goreportcard.com/badge/github.com/majohn-r/mp3)](https://goreportcard.com/report/github.com/majohn-r/mp3)
10-
[![Build Status](https://img.shields.io/github/actions/workflow/status/majohn-r/mp3/build.yml?branch=main)](https://github.com/majohn-r/mp3/actions?query=workflow%3Abuild+branch%3Amain)
7+
[![Release](https://img.shields.io/github/v/release/majohn-r/mp3repair?include_prereleases)](https://github.com/majohn-r/mp3repair/releases)
8+
[![Code Coverage Report](https://codecov.io/github/majohn-r/mp3repair/branch/main/graph/badge.svg)](https://codecov.io/github/majohn-r/mp3repair)
9+
[![Go Report Card](https://goreportcard.com/badge/github.com/majohn-r/mp3repair)](https://goreportcard.com/report/github.com/majohn-r/mp3repair)
10+
[![Build Status](https://img.shields.io/github/actions/workflow/status/majohn-r/mp3repair/build.yml?branch=main)](https://github.com/majohn-r/mp3repair/actions?query=workflow%3Abuild+branch%3Amain)
1111

12-
- [mp3](#mp3)
12+
- [mp3repair](#mp3repair)
1313
- [Purpose](#purpose)
1414
- [Commands](#commands)
1515
- [about](#about)
@@ -51,16 +51,17 @@
5151

5252
## Purpose
5353

54-
The purpose of the **mp3** project is to help manage _mp3_ sound files in
55-
Windows.
54+
The purpose of the **mp3repair** project is to repair the metadata contained in
55+
_mp3_ sound files in Windows.
5656

5757
## Commands
5858

59-
The **mp3** program supports the following commands:
59+
The **mp3repair** program supports the following commands:
6060

6161
### about
6262

63-
The **about** command provides information about the **mp3** program, including:
63+
The **about** command provides information about the **mp3repair** program,
64+
including:
6465

6566
- The program version
6667
- The build timestamp
@@ -83,25 +84,25 @@ Argument Name | Value | Default Value | Description
8384

8485
##### -empty
8586

86-
If **true**, **mp3** ignores the **-albumFilter** and **-artistFilter**
87+
If **true**, **mp3repair** ignores the **-albumFilter** and **-artistFilter**
8788
settings. An _artist_ directory is any subdirectory of the **-topDir**
88-
directory, and **mp3** considers it to be empty if it contains no
89+
directory, and **mp3repair** considers it to be empty if it contains no
8990
subdirectories. An album directory is any subdirectory of an artist directory
90-
and **mp3** considers it empty if it contains no mp3 files.
91+
and **mp3repair** considers it empty if it contains no mp3 files.
9192

9293
##### -gaps
9394

94-
**mp3** assumes that the mp3 files in an album directory are numbered as tracks,
95-
starting with **1** and ending with **N** where **N** is the number of mp3 files
96-
in the directory. If any mp3 files have an associated track number outside the
97-
range of **1..N**, **mp3** lists them in the output, as well as any track
98-
numbers in the expected range that are not associated with any mp3 files in the
99-
directory.
95+
**mp3repair** assumes that the mp3 files in an album directory are numbered as
96+
tracks, starting with **1** and ending with **N** where **N** is the number of
97+
mp3 files in the directory. If any mp3 files have an associated track number
98+
outside the range of **1..N**, **mp3repair** lists them in the output, as well
99+
as any track numbers in the expected range that are not associated with any mp3
100+
files in the directory.
100101

101102
##### -integrity
102103

103-
**mp3** reads the **mp3 tags** for each track file; the **-integrity** check
104-
looks for discrepancies between that data and the files:
104+
**mp3repair** reads the **mp3 metadata** for each track file; the **-integrity**
105+
check looks for discrepancies between that data and the files:
105106

106107
- Verify that the track file name begins with the track number encoded in the
107108
_TRCK_ (track number/position in set) frame of the ID3V2 tag and the track
@@ -143,7 +144,8 @@ illegal in WIndows file names:
143144

144145
### export
145146

146-
The **export** command provides a means for exporting data to the file system. It is governed by these command arguments:
147+
The **export** command provides a means for exporting data to the file system.
148+
It is governed by these command arguments:
147149

148150
Argument Name | Value | Default Value | Description
149151
---------------+---------+---------------+-------------
@@ -154,8 +156,8 @@ Argument Name | Value | Default Value | Description
154156

155157
##### -defaults
156158

157-
If true, **mp3** writes the command defaults to a file named **defaults.yaml**
158-
in the **%APPDATA%\mp3** directory.
159+
If true, **mp3repair** writes the command defaults to a file named
160+
**defaults.yaml** in the **%APPDATA%\mp3repair** directory.
159161

160162
### list
161163

@@ -176,17 +178,17 @@ Argument Name | Value | Default Value | Description
176178

177179
##### -annotate
178180

179-
If true, **mp3** provides the following annotations:
181+
If true, **mp3repair** provides the following annotations:
180182

181183
1. Album names will include the recording artist if artists are not included
182184
(**-includeArtists=false**)
183185
2. Track names will include the album name if albums are not included
184-
(**-includeAlbums=false**), and the recording artist if artists are also not included
185-
(**-includeArtists=false**)
186+
(**-includeAlbums=false**), and the recording artist if artists are also not
187+
included (**-includeArtists=false**)
186188

187189
##### -details
188190

189-
If true, **mp3** provides the following details, if available:
191+
If true, **mp3repair** provides the following details, if available:
190192

191193
1. Composer, which corresponds to the _TCOM_ (Composer) frame of the track's
192194
ID3V2 tag.
@@ -207,15 +209,15 @@ Allowed values are **numeric** and **alpha**. If **numeric** sorting is
207209
reqested, track and album listing must both be enabled; otherwise, it makes no
208210
sense.
209211

210-
If any value other than **numeric** or **alpha** is used, **mp3** will be
212+
If any value other than **numeric** or **alpha** is used, **mp3repair** will be
211213
replace it with an appropriate value as follows:
212214

213-
1. If tracks are not listed (**-includeTracks=false**), **mp3** ignores the
214-
value.
215+
1. If tracks are not listed (**-includeTracks=false**), **mp3repair** ignores
216+
the value.
215217
2. If tracks and albums are listed (**-includeTracks=true** and
216-
**-includeAlbums=true**), **mp3** replaces the value with **numeric**.
218+
**-includeAlbums=true**), **mp3repair** replaces the value with **numeric**.
217219
3. If tracks are listed (**-includeTracks=true**) but albums are not listed
218-
(**-includeAlbums=false**), **mp3** replaces the value with **alpha**.
220+
(**-includeAlbums=false**), **mp3repair** replaces the value with **alpha**.
219221

220222
### postRepair
221223

@@ -251,7 +253,7 @@ command has edited at least one mp3 file since the last time the
251253
If you need to reset the database (for instance: because you used another
252254
program such as **WinAmp** to edit mp3 file metadata) and the **resetDatabase**
253255
command insists that it doesn't need to do anything, simply create a file named
254-
**metadata.dirty** in the **%APPDATA%\mp3** directory and run the
256+
**metadata.dirty** in the **%APPDATA%\mp3repair** directory and run the
255257
**resetDatabase** command again.
256258

257259
The **resetDatabase** command has the following command arguments:
@@ -322,11 +324,11 @@ to specify different values for those command arguments.
322324
The user may find that she is constantly overriding some command arguments on
323325
the command line with the same values. The user can simplify their usage and
324326
override the default command argument values by placing a text file named
325-
**defaults.yaml** in the **%APPDATA%\mp3** directory. By default, there is no
326-
such directory, and the user must create it; the **export** command can be used
327-
to create a baseline version of the file, in the correct directory.
327+
**defaults.yaml** in the **%APPDATA%\mp3repair** directory. By default, there is
328+
no such directory, and the user must create it; the **export** command can be
329+
used to create a baseline version of the file, in the correct directory.
328330

329-
See [YAML](#yaml) for a brief description of how the **mp3** program uses _YAML_
331+
See [YAML](#yaml) for a brief description of how the **mp3repair** program uses _YAML_
330332
and a link to _YAML_ documentation.
331333

332334
The **defaults.yaml** file may contain seven blocks, all of which are optional:
@@ -423,16 +425,16 @@ A few comments concerning argument values:
423425
424426
Argument values may contain references to environment variables. These can be
425427
specified either in **Windows** format (**%VAR_NAME%**) or in **\*nix** format
426-
(**\$VAR_NAME**), such as **$APPDATA/mp3** or **%APPDATA%\mp3**.
428+
(**\$VAR_NAME**), such as **$APPDATA/mp3repair** or **%APPDATA%\mp3repair**.
427429
428430
The referenced environment variables must exist. Referring to a non-existent
429431
(e.g., misspelled) variable will result in the program failing with one or more
430432
error messages specifying the missing variable.
431433
432434
#### File Separators
433435
434-
File separators, as in a path to the music files, may be forward slashes (**/**) or
435-
backward slashes (**\\**).
436+
File separators, as in a path to the music files, may be forward slashes (**/**)
437+
or backward slashes (**\\**).
436438
437439
#### Numeric Values
438440
@@ -447,15 +449,15 @@ _F_, _false_, _FALSE_, or _False_.
447449
448450
## Environment
449451
450-
**mp3** depends on the following environment variables being set:
452+
**mp3repair** depends on the following environment variables being set:
451453
452-
1. **TMP** or **TEMP** - the system temporary directory. mp3 looks for **TMP**
453-
first, and, if that variable is not defined, then mp3 looks for **TEMP**. One
454-
of them must be set so that log files can be written.
454+
1. **TMP** or **TEMP** - the system temporary directory. mp3repair looks for
455+
**TMP** first, and, if that variable is not defined, then mp3repair looks for
456+
**TEMP**. One of them must be set so that log files can be written.
455457
456458
## Dependencies
457459
458-
**mp3** uses the following third party libraries:
460+
**mp3repair** uses the following third party libraries:
459461
460462
- Basic command structure and logging implementation:
461463
[https://github.com/majohn-r/cmd-toolkit](https://github.com/majohn-r/cmd-toolkit).
@@ -480,21 +482,23 @@ libraries.
480482
MP3 files contain metadata in the form of ID3V2 tags and ID3V1 tags; ID3V1 is
481483
the older tag format and is severely constrained compared to ID3V2, but it is
482484
still widely supported and it is common to find MP3 files that contain both.
483-
While the **mp3** program primarily deals with the richer ID3V2 metadata, the
484-
**check** and **repair** commands will notice when ID3V1 tags are not in sync
485-
with the files and rewrite them as necessary. Information about the **ID3V1**
486-
tag formt can be found here: [https://id3.org/ID3v1](https://id3.org/ID3v1).
485+
While the **mp3repair** program primarily deals with the richer ID3V2 metadata,
486+
the **check** and **repair** commands will notice when ID3V1 tags are not in
487+
sync with the files and rewrite them as necessary. Information about the
488+
**ID3V1** tag formt can be found here:
489+
[https://id3.org/ID3v1](https://id3.org/ID3v1).
487490
488491
### ID3V2.3.0
489492
490-
The **mp3** program depends heavily on the MP3 files containing an **ID3V2.3.0**
491-
tag, which stores information about the audio file, particularly metadata, such
492-
as the title and performer. Information about the **ID3V2.3.0** tag format can
493-
be found here: [https://id3.org/id3v2.3.0](https://id3.org/id3v2.3.0).
493+
The **mp3repair** program depends heavily on the MP3 files containing an
494+
**ID3V2.3.0** tag, which stores information about the audio file, particularly
495+
metadata, such as the title and performer. Information about the **ID3V2.3.0**
496+
tag format can be found here:
497+
[https://id3.org/id3v2.3.0](https://id3.org/id3v2.3.0).
494498
495499
### YAML
496500
497-
The **mp3** program reads user-supplied files, written in YAML, for purposes
498-
such as configuring default argument values. For information on writing such
499-
files, the **YAML** specification can be found here:
501+
The **mp3repair** program reads user-supplied files, written in YAML, for
502+
purposes such as configuring default argument values. For information on writing
503+
such files, the **YAML** specification can be found here:
500504
[https://yaml.org/spec/1.2.2/](https://yaml.org/spec/1.2.2/).

build/buildData.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- function: application
3-
value: mp3.exe
3+
value: mp3repair.exe
44
description: mp3 repair utility
55
- function: path
66
value: .

build/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module mp3/build
1+
module mp3repair/build
22

33
go 1.22
44

cmd/about.go

+3-13
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,9 @@ import (
1212
"github.com/spf13/cobra"
1313
)
1414

15-
/*
16-
The **about** command provides information about the **mp3** program, including:
17-
18-
- The program version
19-
- The build timestamp
20-
- Copyright information
21-
- The version of go used to compile the code
22-
- A list of dependencies and their versions
23-
*/
24-
2515
const (
2616
aboutCommand = "about"
27-
appName = "mp3" // the name of the application
17+
appName = "mp3repair" // the name of the application
2818
author = "Marc Johnson"
2919
firstYear = 2021 // the year when development of this application began
3020
)
@@ -37,9 +27,9 @@ var (
3727
// AboutCmd represents the about command
3828
AboutCmd = &cobra.Command{
3929
Use: aboutCommand,
40-
Short: "Provides information about the mp3 program",
30+
Short: "Provides information about the " + appName + " program",
4131
Long: fmt.Sprintf("%q", aboutCommand) +
42-
` provides the following information about the mp3 program:
32+
` provides the following information about the ` + appName + ` program:
4333
4434
* The program version and build timestamp
4535
* Copyright information

0 commit comments

Comments
 (0)