Skip to content

Fix Globbing on Windows; add .gitignore#27

Open
TAbdiukov wants to merge 3 commits into
dmulholl:masterfrom
TAbdiukov:Fix-Glob
Open

Fix Globbing on Windows; add .gitignore#27
TAbdiukov wants to merge 3 commits into
dmulholl:masterfrom
TAbdiukov:Fix-Glob

Conversation

@TAbdiukov

@TAbdiukov TAbdiukov commented Jul 11, 2024

Copy link
Copy Markdown

Changes

  • Fix Globbing by manually evaluating files with Go's Glob functionality
  • Do not match duplicate files
  • Add specific to this repo .gitignore (ignores .mp3s for git)

Demo (v2)


C:\mp3>ver

Microsoft Windows [Version 10.0.19044.4780]

C:\mp3>dir /w
 Volume in drive C has no label.
 Volume Serial Number is 6A3E-D67E

 Directory of C:\mp3

[.]                             [..]                            00.mp3
01.mp3                          02.mp3                          03.mp3
04.mp3                          05.mp3                          06.mp3
07.mp3                          08.mp3                          09.mp3
10.mp3                          11.mp3                          12.mp3
13.mp3                          14.mp3                          15.mp3
16.mp3                          17.mp3                          18.mp3
19.mp3                          20.mp3                          21.mp3
22.mp3                          23.mp3                          24.mp3
25.mp3                          26.mp3                          27.mp3
28.mp3                          29.mp3                          30.mp3
31.mp3                          32.mp3                          33.mp3
34.mp3                          35.mp3                          36.mp3
37.mp3                          38.mp3                          39.mp3
40.mp3                          41.mp3                          42.mp3
43.mp3                          44.mp3                          45.mp3
46.mp3                          47.mp3                          cover.jpg
mp3cat-improved-TAbdiukov.exe
              50 File(s)    398.238.306 bytes
               2 Dir(s)  37.585.575.936 bytes free

C:\mp3>echo "Let's say I want to merge only files that are 3*.mp3 and *7.mp3"
"Let's say I want to merge only files that are 3*.mp3 and *7.mp3"

C:\mp3>mp3cat-improved-TAbdiukov.exe 3*.mp3 *7.mp3 -o output.mp3
------------------------------------------------------------------------------------------------------------------------
+ 30.mp3
+ 31.mp3
+ 32.mp3
+ 33.mp3
+ 34.mp3
+ 35.mp3
+ 36.mp3
+ 37.mp3
+ 38.mp3
+ 39.mp3
+ 07.mp3
+ 17.mp3
+ 27.mp3
+ 47.mp3
------------------------------------------------------------------------------------------------------------------------
• Multiple bitrates detected. Adding VBR header.
• 14 files merged.
------------------------------------------------------------------------------------------------------------------------

C:\mp3>

@TAbdiukov

Copy link
Copy Markdown
Author

Issue in question: #26

@TAbdiukov

Copy link
Copy Markdown
Author

I updated the code further, so that additional globbing does not cause duplicate files to be matched twice (or more). I also updated the Demo.

Notice how in demo, a command of,

mp3cat-improved-TAbdiukov.exe 3*.mp3 *7.mp3 -o output.mp3

Only matches file 37.mp3 once!

Thanks again

@kaiodsiqueira

Copy link
Copy Markdown

Had the same issue here, thanks for the PR. You saved me!

@TAbdiukov

TAbdiukov commented Sep 21, 2024

Copy link
Copy Markdown
Author

Had the same issue here, thanks for the PR. You saved me!

@kaiotellure , I'm glad I could help 🙇‍♂️

@h3rb

h3rb commented Jan 4, 2025

Copy link
Copy Markdown

Has issues with spaces in filename. If you enclose in quotes, the globbing doesn't happen
image_2025-01-03_235304789

@TAbdiukov

Copy link
Copy Markdown
Author

mp3cat failing is normal. PowerShell does not run executables from the current directory unless you use a path such as .\mp3cat.exe, or the directory is on PATH. Microsoft documents this as a security feature.'

Quoting is required because the path contains spaces. PowerShell’s own docs say arguments containing spaces, such as paths, must be quoted.

@TAbdiukov

Copy link
Copy Markdown
Author

I am awaiting @dmulholl to apply changes. They do not, and it would be great if there were a greater pushback for changes to be made. But until it happens, this discussion is a bit like waiting for a miracle to happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants