Skip to content

Commit 71d117f

Browse files
committed
Library project tweaks
1 parent d240d38 commit 71d117f

3 files changed

Lines changed: 49 additions & 49 deletions

File tree

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Additionally, your original audio files will be modified during selected operati
88

99
## Requirements
1010

11-
- [.NET 9 runtime](https://dotnet.microsoft.com/en-us/download/dotnet/9.0)
11+
- [.NET 10 runtime](https://dotnet.microsoft.com/en-us/download/dotnet/10.0)
1212
- `settings.json` (See below)
1313

1414
## Running
@@ -36,24 +36,24 @@ dotnet run -- -r ~/Downloads/Audio/
3636

3737
## Flags
3838

39-
| Flags | Description
39+
| Flags | Description |
4040
|---|---|
41-
| -v, --view | View full tag data.
42-
| -vs, --view-summary | View a summary of tag data.
43-
| -u, --update | Update tag data using filename patterns from the settings.
44-
| -u1, --update-single | Update a single tag in multiple files to a single, manually-specified value.
45-
| -ug, --update-genres | Update the genres in all files automatically using the CSV specified in the settings.
46-
| -um, --update-multiple | Update a single tag in multiple files with multiple values.
47-
| -uy, --update-year | Update the year using media files' own dates of creation. (Must do before other updates, lest the creation date be modified by those updates.)
48-
| -urt, --reverse-track-numbers | Reverse the track numbers of the given files.
49-
| -uea, --extract-artwork | Extracts artwork from directory files if they have the same artist and album, then deletes the artwork from the files containing it.
50-
| -ura, --remove-artwork | Removes artwork from files. (File size is not reduced, as padding remains.)
51-
| -rt, --rewrite-tags | Rewrites file tags. (Can be helping in reducing padding, such as from removed artwork.)
52-
| -r, --rename | Rename and reorganize files into folders based on tag data.
53-
| -d, --duplicates | List tracks with identical artists and titles. No files are modified or deleted.
54-
| -s, --stats | Display file statistics based on tag data.
55-
| -g, --genres | Save the primary genre for each artist to a genre file.
56-
| -p, --parse | Get a single tag value by parsing the data of another (generally Comments).
41+
| -v, --view | View full tag data. |
42+
| -vs, --view-summary | View a summary of tag data. |
43+
| -u, --update | Update tag data using filename patterns from the settings. |
44+
| -u1, --update-single | Update a single tag in multiple files to a single, manually-specified value. |
45+
| -ug, --update-genres | Update the genres in all files automatically using the CSV specified in the settings. |
46+
| -um, --update-multiple | Update a single tag in multiple files with multiple values. |
47+
| -uy, --update-year | Update the year using media files' own dates of creation. (Must do before other updates, lest the creation date be modified by those updates.) |
48+
| -urt, --reverse-track-numbers | Reverse the track numbers of the given files. |
49+
| -uea, --extract-artwork | Extracts artwork from directory files if they have the same artist and album, then deletes the artwork from the files containing it. |
50+
| -ura, --remove-artwork | Removes artwork from files. (File size is not reduced, as padding remains.) |
51+
| -rt, --rewrite-tags | Rewrites file tags. (Can be helping in reducing padding, such as from removed artwork.) |
52+
| -r, --rename | Rename and reorganize files into folders based on tag data. |
53+
| -d, --duplicates | List tracks with identical artists and titles. No files are modified or deleted. |
54+
| -s, --stats | Display file statistics based on tag data. |
55+
| -g, --genres | Save the primary genre for each artist to a genre file. |
56+
| -p, --parse | Get a single tag value by parsing the data of another (generally Comments). |
5757

5858
Passing no arguments will also display these instructions.
5959

@@ -72,7 +72,7 @@ A sample settings file, which can you copy and paste if you wish, follows:
7272
"(?:(?<albumArtists>.+) ≡ )?(?<album>.+?)(?: ?\\[(?<year>\\d{4})\\])? = (?<trackNo>\\d+) [–-] (?<artists>.+?) [–-] (?<title>.+)(?=\\.(?:m4a|opus))",
7373
"(?:(?<albumArtists>.+) ≡ )?(?<album>.+?)(?: ?\\[(?<year>\\d{4})\\])? = (?<trackNo>\\d{1,3}) [–-] (?<title>.+)(?=\\.(?:m4a|opus))",
7474
"(?:(?<albumArtists>.+) ≡ )(?<album>.+?)(?: ?\\[(?<year>\\d{4})\\])? = (?<artists>.+?) [–-] (?<title>.+)(?=\\.(?:m4a|opus))",
75-
"(?:(?<albumArtists>.+) ≡ )?(?<album>.+?)(?: ?\\[(?<year>\\d{4})\\])? = (?<title>.+)(?=\\.(?:m4a|opus))", ]
75+
"(?:(?<albumArtists>.+) ≡ )?(?<album>.+?)(?: ?\\[(?<year>\\d{4})\\])? = (?<title>.+)(?=\\.(?:m4a|opus))" ]
7676
},
7777
"renaming": {
7878
"useAlbumDirectories": true,
@@ -99,7 +99,7 @@ A sample settings file, which can you copy and paste if you wish, follows:
9999
"exclusions": [
100100
{ "artist": "Artist Name" },
101101
{ "title": "Track Title" },
102-
{ "artist": "Artist Name", "title": "Track Title" },
102+
{ "artist": "Artist Name", "title": "Track Title" }
103103
],
104104
"artistReplacements": [
105105
" ",
@@ -131,7 +131,7 @@ A sample settings file, which can you copy and paste if you wish, follows:
131131
":",
132132
""
133133
]
134-
},
134+
}
135135
}
136136
```
137137

src/AudioTagger.Library/MediaFiles/MediaFileExtensionMethods.cs

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,40 @@ namespace AudioTagger.Library.MediaFiles;
22

33
public static class MediaFileExtensionMethods
44
{
5-
/// <summary>
6-
/// Joins a collection into one string using a specified separator string.
7-
/// </summary>
8-
/// <param name="collection"></param>
9-
/// <param name="separator"></param>
10-
/// <returns>A joined string. Never returns null.</returns>
11-
public static string Join(this IEnumerable<string> collection, string separator = "; ")
5+
extension(IEnumerable<string> first)
126
{
13-
return string.Join(separator, collection);
14-
}
7+
/// <summary>
8+
/// Joins a collection into one string using a specified separator string.
9+
/// </summary>
10+
/// <param name="separator"></param>
11+
/// <returns>A joined string. Never returns null.</returns>
12+
public string Join(string separator = "; ")
13+
{
14+
return string.Join(separator, first);
15+
}
1516

16-
/// <summary>
17-
/// Joins two collections into one formatted string. If their contents differ, then both will be included
18-
/// with the second collection placed within parentheses after the first collection.
19-
/// </summary>
20-
/// <param name="first">This collection is given priority.</param>
21-
/// <param name="second">This collection will not be added if it is identical to the primary one.</param>
22-
/// <param name="separator">Applies to each collection separately.</param>
23-
/// <returns>A combined string. Never returns null. Example: "first1; first2 (second1; second2)"</returns>
24-
public static string JoinWith(this IEnumerable<string> first, IEnumerable<string> second, string separator = "; ")
25-
{
26-
string Joiner(IEnumerable<string> collection) => string.Join(separator, collection);
17+
/// <summary>
18+
/// Joins two collections into one formatted string. If their contents differ, then both will be included
19+
/// with the second collection placed within parentheses after the first collection.
20+
/// </summary>
21+
/// <param name="second">This collection will not be added if it is identical to the primary one.</param>
22+
/// <param name="separator">Applies to each collection separately.</param>
23+
/// <returns>A combined string. Never returns null. Example: "first1; first2 (second1; second2)"</returns>
24+
public string JoinWith(IEnumerable<string> second, string separator = "; ")
25+
{
26+
string Joiner(IEnumerable<string> collection1) => string.Join(separator, collection1);
2727

28-
if (first?.Any() != true)
29-
return Joiner(second);
28+
if (!first.Any())
29+
return Joiner(second);
3030

31-
if (second?.Any() != true)
32-
return Joiner(first);
31+
if (!second.Any())
32+
return Joiner(first);
3333

34-
if (first.Count() != second.Count())
35-
return $"{Joiner(first)} ({Joiner(second)})";
34+
if (first.Count() != second.Count())
35+
return $"{Joiner(first)} ({Joiner(second)})";
3636

37-
return Joiner(first); // Identical collections of equal length, so only print the first.
37+
return Joiner(first); // Identical collections of equal length, so only print the first.
38+
}
3839
}
3940

4041
/// <summary>

src/AudioTagger.Library/UpdatableFields.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public sealed class UpdatableFields
2020
/// Constructor that reads matched regex group names and
2121
/// maps the data to the correct tag name property.
2222
/// </summary>
23-
/// <param name="matchedGroups"></param>
2423
public UpdatableFields(
2524
IEnumerable<Group> matchedGroups,
2625
IDictionary<string, string> artistsWithGenres)

0 commit comments

Comments
 (0)