Skip to content

Instantly share code, notes, and snippets.

@VxJasonxV
Last active April 29, 2021 18:51
Show Gist options
  • Save VxJasonxV/7ffbbd0dd4991337b12eedf01cf6dab6 to your computer and use it in GitHub Desktop.
Save VxJasonxV/7ffbbd0dd4991337b12eedf01cf6dab6 to your computer and use it in GitHub Desktop.
ONESEVENTY Releases 51-100
require 'wavefile'
include WaveFile
releases = Dir.glob("/Volumes/ONESEVENTY/Singles/*")
releases.each do |r|
tracklist = []
catno, album_artist, album_name = File.basename(r).split(' - ')
tracks = Dir.glob("#{r}/*.wav")
tracks.sort_by! { |f| f.match("Radio Edit") ? 0 : 1 }
tracks.each_with_index do |t, i|
wav = Reader.new(t)
t = File.basename(t, '.wav')require 'wavefile'
include WaveFile
releases = Dir.glob("/Volumes/ONESEVENTY/Singles/*")
releases.each do |r|
tracklist = []
catno, album_artist, album_name = File.basename(r).split(' - ')
tracks = Dir.glob("#{r}/*.wav")
tracks.sort_by! { |f| f.match("Radio Edit") ? 0 : 1 }
tracks.each_with_index do |t, i|
wav = Reader.new(t)
t = File.basename(t, '.wav')
parts = t.split(' - ')
duration = wav.total_duration
length = duration.minutes.to_s.rjust(2, "0") << ":" <<
duration.seconds.to_s.rjust(2, "0")
tracklist << {
track_nr: sprintf('%02d', i),
artist: parts[1], # 51-100 has the release number in the track filename now...
title: parts[2..-1],
length: length
}
end
seed = <<-HTML
<html>
<head>
</head>
<body>
<form name="form" id="form" action="https://musicbrainz.org/release/add" method="POST">
<input name="name" type="text" value="#{album_name}" /><br />
<input name="artist_credit.names.0.name" type="text" value="#{album_artist}" /><br />
<input name="language" type="text" value="eng" /><br />
<input name="script" type="text" value="Latn" /><br />
<input name="type" type="text" value="single" />
<input name="status" type="text" value="official" /><br />
<input name="packaging" type="text" value="none" /><br />
<input name="events.0.country" type="text" value="XW" /><br />
<input name="labels.0.mbid" type="text" value="cab8241b-2b65-4c4c-9291-f2e64e8e56ca" />
<input name="labels.0.catalog_number" type="text" value="ONESEVENTY#{catno}" /><br />
<input name="mediums.0.format" type="text" value="Digital Media" /> <br />
HTML
tracklist.each_with_index do |t, i|
seed << <<-HTML
<input name="mediums.0.track.#{i}.name" type="text" value="#{t[:title][0]}"/>
<input name="mediums.0.track.#{i}.length" type="text" value="#{t[:length]}"/><br />
HTML
end
seed << <<-HTML
<input name="urls.0.url" type="text" value="https://www.oneseventy.net/label-store"/>
<input name="urls.0.link_type" type="text" value="74"/><br />
<textarea name="edit_note" type="text">Data comes from https://www.oneseventy.net/single-post/oneseventy-volume-two-releases-51-100-8gb-usb-now-available-for-pre-order which I have in my possession.
This volume contains WAV files with no metadata, all data is programmatically derived from directory names and file names. ls tree output at https://gist.github.com/VxJasonxV/7ffbbd0dd4991337b12eedf01cf6dab6 , source used for this automation there as well.
Media does not contain track numbers on albums with > 1 track. I have opted to put Radio Edits first which is what I've conventionally seen on digital releases, such as https://music.apple.com/us/album/reflections-feat-lokka-vox-single/1477673119 for example. All other tracks will be alphabetically sorted.</textarea><br />
<input type="submit" value="seed">
</form>
</body>
</html>
HTML
puts seed
File.write("#{ENV['HOME']}/tmp/seed.html", seed)
system('open', "#{ENV['HOME']}/tmp/seed.html")
gets
end
parts = t.split(' - ')
duration = wav.total_duration
length = duration.minutes.to_s.rjust(2, "0") << ":" <<
duration.seconds.to_s.rjust(2, "0")
tracklist << {
track_nr: sprintf('%02d', i),
artist: parts[0],
title: parts[1..-1],
length: length
}
end
seed = <<-HTML
<html>
<head>
</head>
<body>
<form name="form" id="form" action="https://musicbrainz.org/release/add" method="POST">
<input name="name" type="text" value="#{album_name}" /><br />
<input name="artist_credit.names.0.name" type="text" value="#{album_artist}" /><br />
<input name="language" type="text" value="eng" /><br />
<input name="script" type="text" value="Latn" /><br />
<input name="type" type="text" value="single" />
<input name="status" type="text" value="official" /><br />
<input name="packaging" type="text" value="none" /><br />
<input name="events.0.country" type="text" value="XW" /><br />
<input name="labels.0.mbid" type="text" value="cab8241b-2b65-4c4c-9291-f2e64e8e56ca" />
<input name="labels.0.catalog_number" type="text" value="ONESEVENTY#{catno}" /><br />
<input name="mediums.0.format" type="text" value="Digital Media" /> <br />
HTML
tracklist.each_with_index do |t, i|
seed << <<-HTML
<input name="mediums.0.track.#{i}.name" type="text" value="#{t[:title][0]}"/>
<input name="mediums.0.track.#{i}.length" type="text" value="#{t[:length]}"/><br />
HTML
end
seed << <<-HTML
<input name="urls.0.url" type="text" value="https://www.oneseventy.net/label-store"/>
<input name="urls.0.link_type" type="text" value="74"/><br />
<textarea name="edit_note" type="text">Data comes from https://www.oneseventy.net/single-post/oneseventy-volume-two-releases-51-100-8gb-usb-now-available-for-pre-order which I have in my possession.
This volume contains WAV files with no metadata, all data is programmatically derived from directory names and file names. ls tree output at https://gist.github.com/VxJasonxV/7ffbbd0dd4991337b12eedf01cf6dab6 , source used for this automation there as well.
Media does not contain track numbers on albums with > 1 track. I have opted to put Radio Edits first which is what I've conventionally seen on digital releases, such as https://music.apple.com/us/album/reflections-feat-lokka-vox-single/1477673119 for example. All other tracks will be alphabetically sorted.</textarea><br />
<input type="submit" value="seed">
</form>
</body>
</html>
HTML
puts seed
File.write("#{ENV['HOME']}/tmp/seed.html", seed)
system('open', "#{ENV['HOME']}/tmp/seed.html")
gets
end
/Volumes/ONESEVENTY/Singles/
├── 051 - JTS - World Out There
│   ├── 051 - JTS - World Out There (Extended Mix).wav
│   ├── 051 - JTS - World Out There (Radio Edit).wav
│   └── 051.jpg
├── 052 - Technikore & Ravine - Freakz (Alex Kidd presents AK47 Remix)
│   ├── 052 - Technikore & Ravine - Freakz (Alex Kidd presents AK47 Extended Remix).wav
│   ├── 052 - Technikore & Ravine - Freakz (Alex Kidd presents AK47 Radio Edit).wav
│   └── 052.jpg
├── 053 - Dougal - Take Me Away
│   ├── 053 - Dougal - Take Me Away (Extended Mix).wav
│   ├── 053 - Dougal - Take Me Away (Radio Edit).wav
│   └── 053.jpg
├── 054 - Scott Brown, Technikore & JTS - Low End Theory
│   ├── 054 - Scott Brown, Technikore & JTS - Low End Theory (Extended Mix).wav
│   ├── 054 - Scott Brown, Technikore & JTS - Low End Theory (Radio Edit).wav
│   └── 054.jpg
├── 055 - Hixxy - Sacrifice (Ben Defekt & Olly P Remix)
│   ├── 055 - Hixxy - Sacrifice (Ben Defekt & Olly P Extended Remix).wav
│   ├── 055 - Hixxy - Sacrifice (Ben Defekt & Olly P Radio Edit).wav
│   └── 055.jpg
├── 056 - Dougal - Shine On You
│   ├── 056 - Dougal - Shine On You (Extended Mix).wav
│   ├── 056 - Dougal - Shine On You (Radio Edit) .wav
│   └── 056.jpg
├── 057 - Technikore - Think About You
│   ├── 057 - Technikore - Think About You (Extended Mix).wav
│   ├── 057 - Technikore - Think About You (Radio Edit).wav
│   └── 057.jpg
├── 058 - Jakka-B feat. Addie Nicole - Chasing The Sun
│   ├── 058 - Jakka B feat. Addie Nicole - Chasing The Sun (Extended Mix).wav
│   ├── 058 - Jakka B feat. Addie Nicole - Chasing The Sun (Radio Edit).wav
│   └── 058.jpg
├── 059 - Weaver & JTS - Krunk Like
│   ├── 059 - Weaver & JTS - Krunk Like (Extended Mix).wav
│   ├── 059 - Weaver & JTS - Krunk Like (Radio Edit).wav
│   └── 059.jpg
├── 060 - Technikore & JTS - Worlds Collide (Game Remix)
│   ├── 060 - Technikore & JTS - Worlds Collide (Game Radio Edit).wav
│   ├── 060 - Technikore & JTS - Worlds Collide (Game Remix) (Extended Mix).wav
│   └── 060.jpg
├── 061 - Jakka-B feat. Saydi Driggers - Take Me Home
│   ├── 061 - Jakka-B feat. Saydee Driggers - Take Me Home (Radio Edit).wav
│   ├── 061 - Jakka-B feat. Saydi Driggers - Take Me Home (Extended Mix).wav
│   └── 061.jpg
├── 062 - Alex Kidd presents AK47 - WTF
│   ├── 062 - Alex Kidd presents AK47 - WTF (Extended Mix).wav
│   ├── 062 - Alex Kidd presents AK47 - WTF (Radio Edit).wav
│   └── 062.jpg
├── 063 - Dougal x Technikore x JTS - Two Hearts
│   ├── 063 - Dougal x Technikore x JTS - Two Hearts (Extended Mix).wav
│   ├── 063 - Dougal x Technikore x JTS - Two Hearts (Radio Edit).wav
│   └── 063.jpg
├── 064 - Technikore & Vicky Fee - Stay Forever (Macks Wolf Remix)
│   ├── 064.jpg
│   ├── 064A - Technikore & Vicky Fee - Stay Forever (Macks Wolf Extended Remix).wav
│   ├── 064A - Technikore & Vicky Fee - Stay Forever (Macks Wolf Radio Edit).wav
│   ├── 064B - Technikore & Vicky Fee - Stay Forever (Original Extended Mix).wav
│   └── 064B - Technikore & Vicky Fee - Stay Forever (Radio Edit).wav
├── 065 - Dougal x Technikore x JTS - Never Be Alone
│   ├── 065 - Dougal x Technikore x JTS - Never Be Alone (Radio Edit).wav
│   ├── 065 - Dougal, Technikore & JTS - Never Be Alone (Extended Mix).wav
│   └── 065.jpg
├── 066 - Hixxy - Deep In The Night (Jakka-B Remix)
│   ├── 066 - Hixxy - Deep In The Night (Jakka-B Extended Remix) .wav
│   ├── 066 - Hixxy - Deep In The Night (Jakka-B Radio Edit).wav
│   └── 066.jpg
├── 067 - Mike Reverie - Ladies x Fellas
│   ├── 067 - Mike Reverie - Ladies x Fellas (Extended Mix).wav
│   ├── 067 - Mike Reverie - Ladies x Fellas (Radio Edit).wav
│   └── 067.jpg
├── 068 - Summa Jae feat. KYRK - Find Me
│   ├── 068 - Summa Jae feat. KYRK - Find Me (Extended Mix).wav
│   ├── 068 - Summa Jae feat. KYRK - Find Me (Radio Edit).wav
│   └── 068.jpg
├── 069 - J-Trax - Can't Go Home
│   ├── 069 - J-Trax - Can't Go Home (Extended Mix).wav
│   ├── 069 - J-Trax - Can't Go Home (Radio Edit).wav
│   └── 069.jpg
├── 070 - JTS - Better Now
│   ├── 070 - JTS - Better Now (Extended Mix).wav
│   ├── 070 - JTS - Better Now (Radio Edit).wav
│   └── 070.jpg
├── 071 - Two Minds Project - Opus (Dreams)
│   ├── 071 - Two Minds Project - Opus (Dreams) (Extended Mix).wav
│   ├── 071 - Two Minds Project - Opus (Dreams) (Radio Edit).wav
│   └── 071.jpg
├── 072 - Technikore - Tick Tock
│   ├── 072 - Technikore - Tick Tock (Extended Mix).wav
│   ├── 072 - Technikore - Tick Tock (Radio Edit).wav
│   └── 072.jpg
├── 073 - Two Minds Project - Scared
│   ├── 073 - Two Minds Project - Scared (Extended Mix).wav
│   ├── 073 - Two Minds Project - Scared (Radio Edit).wav
│   └── 073.jpg
├── 074 - Mike Enemy - Sunkissed
│   ├── 074 - Mike Enemy - Sunkissed (Extended Mix).wav
│   ├── 074 - Mike Enemy - Sunkissed (Radio Edit).wav
│   └── 074.jpg
├── 075 - Mike Reverie - I Can't Breathe
│   ├── 075 - Mike Reverie - I Can't Breathe (Extended Mix).wav
│   ├── 075 - Mike Reverie - I Can't Breathe (Radio Edit).wav
│   └── 075.jpg
├── 076 - Olly P - Horizon
│   ├── 076 - Olly P - Horizon (Extended Mix).wav
│   ├── 076 - Olly P - Horizon (Radio Edit).wav
│   └── 076.jpg
├── 077 - JTS x Technikore - Meet Her At The Love Parade
│   ├── 077 - JTS x Technikore - Meet Her At The Love Parade (Extended Mix).wav
│   ├── 077 - JTS x Technikore - Meet Her At The Love Parade (Radio Edit).wav
│   └── 077.jpg
├── 078 - Summa Jae - Oblivion
│   ├── 078 - Summa Jae - Oblivion (Extended Mix).wav
│   ├── 078 - Summa Jae - Oblivion (Radio Edit).wav
│   └── 078.jpg
├── 079 - Technikore & Suae feat. KYRK - Breaking Free
│   ├── 079 - Technikore & Suae Feat. KYRK - Breaking Free (Radio Edit).wav
│   ├── 079 - Technikore & Suae feat. KYRK - Breaking Free (Extended Mix).wav
│   └── 079.jpg
├── 080 - JTS - Nothing Left
│   ├── 080 - JTS - Nothing Left (Extended Mix).wav
│   ├── 080 - JTS - Nothing Left (Radio Edit).wav
│   └── 080.jpg
├── 081 - J-Trax - If You Want
│   ├── 081 - J-Trax - If You Want (Extended Mix).wav
│   ├── 081 - J-Trax - If You Want (Radio Edit).wav
│   └── 081.jpg
├── 082 - Two Minds Project - Trying
│   ├── 082 - Two Minds Project - Trying (Radio Edit).wav
│   ├── 082 - Two Minds Project - Trying (Extended Master) v2.wav
│   └── 082.jpg
├── 083 - Technikore x AK47 - Control
│   ├── 083 - Technikore x AK47 - Control (Extended Mix) - [AAA Master 13.11.20] V4.wav
│   ├── 083 - Technikore x AK47 - Control (Radio Edit).wav
│   └── 083.jpg
├── 084 - Quickdrop & B0UNC3 presents QUB3 - Memories
│   ├── 084 - Quickdrop & B0UNC3 presents QUB3 - Memories (Extended Mix).wav
│   ├── 084 - Quickdrop & B0UNC3 presents QUB3 - Memories (Radio Edit).wav
│   └── 084.jpg
├── 085 - Technikore & Weaver feat. Lokka Vox - Find You Now (Game Remix)
│   ├── 085 - Technikore & Weaver feat. Lokka Vox - Find You Now (Game Extended Remix).wav
│   ├── 085 - Technikore & Weaver feat. Lokka Vox - Find You Now (Game Radio Edit).wav
│   └── 085.jpg
├── 086 - Summa Jae - If Ever (Technikore Remix)
│   ├── 086 - Summa Jae - If Ever (Technikore Extended Remix).wav
│   ├── 086 - Summa Jae - If Ever (Technikore Radio Edit).wav
│   └── 086.jpg
├── 087 - Mark Breeze & Macks Wolf feat. Heidi Anne - Turn On The Light (JTS Remix)
│   ├── 087 - Mark Breeze & Macks Wolf Feat. Heidi Anne - Turn On The Light (JTS Extended Remix).wav
│   ├── 087 - Mark Breeze & Macks Wolf Feat. Heidi Anne - Turn On The Light (JTS Radio Edit).wav
│   └── 087.jpg
├── 088 - Somna & Jennifer Rene - Stars Collide (Technikore Remix)
│   ├── 088 - Somna & Jennifer Rene - Stars Collide (Technikore Extended Remix).wav
│   ├── 088 - Somna & Jennifer Rene - Stars Collide (Technikore Radio Edit).wav
│   └── 088.jpg
├── 089 - Game - Don't Let Go
│   ├── 089 - Game - Don't Let Go (Extended Mix).wav
│   ├── 089 - Game - Don't Let Go (Radio Edit).wav
│   └── 089.jpg
├── 090 - Weaver & JTS - Krunk Like (AK47 Remix)
│   ├── 090 - Weaver & JTS - Krunk Like (AK47 Extended Remix).wav
│   ├── 090 - Weaver & JTS - Krunk Like (AK47 Radio Edit).wav
│   └── 090.jpg
├── 091 - Macks Wolf - Hit Em Like This (Two Minds Project Remix)
│   ├── 091 - Macks Wolf - Hit Em Like This (Two Minds Project Extended Remix).wav
│   ├── 091 - Macks Wolf - Hit Em Like This (Two Minds Project Radio Edit).wav
│   └── 091.jpg
├── 092 - B0UNC3 - 2 B Cool
│   ├── 092 - B0UNC3 - 2 B Cool (Extended Mix).wav
│   ├── 092 - B0UNC3 - 2 B Cool (Radio Edit).wav
│   └── 092.jpg
├── 093 - Joey Riot x Technikore x Suae - Let Me Hear You Roar
│   ├── 093 - Joey Riot x Technikore x Suae - Let Me Hear You Roar (Extended Mix).wav
│   ├── 093 - Joey Riot x Technikore x Suae - Let Me Hear You Roar (Radio Edit).wav
│   └── 093.jpg
├── 094 - 4 - Dead Love
│   ├── 094 - 4 - Dead Love (Extended Mix).wav
│   ├── 094 - 4 - Dead Love (Radio Edit).wav
│   └── 094.jpg
├── 095 - Ben Nicky x Technikore x JTS - YEET 2.0
│   ├── 095 - Ben Nicky x Technikore x JTS - YEET 2.0 (Extended Mix).wav
│   ├── 095 - Ben Nicky x Technikore x JTS - YEET 2.0 (Radio Edit).wav
│   └── 095.jpg
├── 096 - Skeets x Novakaine - R WE DREAMING
│   ├── 096 - Skeets x Novakaine - R WE DREAMING (Extended Mix).wav
│   ├── 096 - Skeets x Novakaine - R We Dreaming (Radio Edit).wav
│   └── 096.jpg
├── 097 - Technikore - Tick Tock (Quickdrop Remix)
│   ├── 097 - Technikore - Tick Tock (Quickdrop Extended Remix).wav
│   ├── 097 - Technikore - Tick Tock (Quickdrop Radio Edit).wav
│   └── 097.jpg
├── 098 - AK47 x Inquisitive - Turn Me On
│   ├── 098 - AK47 x Inquisitive - Turn Me On (Extended Mix) (Master).wav
│   ├── 098 - AK47 x Inquisitive - Turn Me On (Radio Edit).wav
│   └── 098.jpg
├── 099 - Dougal - Take Me Away (Summa Jae Remix)
│   ├── 099 - Dougal - Take Me Away (Summa Jae Extended Mix).wav
│   ├── 099 - Dougal - Take Me Away (Summa Jae Radio Edit).wav
│   └── 099.jpg
└── 100 - Technikore x JTS feat. Niki Mak - Always
├── 100 - Technikore x JTS Feat. Niki Mak - Always (Extended Mix).wav
├── 100 - Technikore x JTS Feat. Niki Mak - Always (Radio Edit).wav
└── 100.jpg
50 directories, 152 files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment