-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
Staging refs/heads/dev into Main
- Loading branch information
There are no files selected for viewing
This file was deleted.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"items":[{"id":"music/ambient","name":"Ambient","description":"A Collection of Ambient Music\n","tags":["music","ambient"],"ytTracks":["WTsmIbNku5g","qz7tCZE_3wA","LaCd3YrEteE","9Jsbr8CTXKg","YPsjSWxm-LE","wxVc3-yYQ1Y","ScqB4PuOz0Q","-gfdvNwbw-0","PrFrS5HmPB0","pgHuG4JcYpk","91G8APy6lzc","UCjq5C62c3k","yoZPVMEsbeQ"],"ytSets":["7TML_MTQdg4"]},{"id":"music/chillstep","name":"ChillStep","description":"ChillStep Collection\n","tags":["music","chillstep"],"ytTracks":["UOT8_5U7lLs","oHUlM6dcTXQ","KNf030fD5UY","yyqdG89zz58","o4RdwCeM-Kc","4fQeaM62mOY","_OTnxLtaFyA"],"ytSets":["7TML_MTQdg4"]},{"id":"music/dnb","name":"Drum and Bass","description":"Shallou Music Collection\n","tags":["music","dnb"],"ytTracks":["S2TaAcwC_zI","rkjNL4dX-U4","aaQetOuCJf8","3eNCSxMYSrs","bE3Kvqyef_E","VGJlu7nlikY","CK3iO3F55BQ","7BmjVI712IE","yzf_pVGMNYo","hlRwWLiuNXc","uJkL1-s3PL8","zW2ZBUo-T6o","sz2-kugDhGE","rOdd20JHR40","9VmOLMV0U2w","6MnMjUxuOlA","2QvT07zAH8c","W4rnTAkMFWY","deTJ513J07Y","T7hlzIC6d-E","mlQX_MGA1gc"],"ytSets":["Zy_JR9_Y8dE"]},{"id":"music/edm","name":"EDM","description":"Electronic Dance Movement\n","tags":["music","edm"],"ytTracks":["cSPfeTwl8Kw","YRrYClM0ly4","AhCfxBULO4w","0ZIyfw_M1Vc","FUdqnxUpaTk","ccz-kU20ExU","IQygUD54_ng","HH4TrLtfzMM","fAkmcZ3mshs","UFIoulOgprU","s8XIgR5OGJc","Yifz3X_i-F8","2XG_0iV2B40","ZeaIvjoH1FY","EsGiBwK4Ycc","d6azy4Ep_Os","E7BZwEgTOIM","_y8p6uQDH4s","zgI2K5hydX8","W0W1c_qH9sQ","MqsMZi087bc","WinkoZiOYQc","pBru4MPtEik","bcDr5Nw0Kfg","xXnyoFYNlGw","f1O6BY49APw","6lGV3l1WbLs","mDSm5dKnGnA"],"ytSets":["IenNFcc6p4U","OPAy-sQQ7xU"]},{"id":"music/electroswing","name":"Electro Swing","description":"Electro Swing\n","tags":["music","electroswing"],"ytTracks":["s1xv5eAppKo"],"ytSets":["CJgi8WEVh6k"]},{"id":"music/lofihiphop","name":"Lofi HipHop","description":"Delve into the captivating realm of lofi hip hop with our detailed guide.\nUnearth top artists, essential tracks, production techniques, and the intriguing history behind the genre's mellow beats.\nPerfect for fans and creators alike.\n","tags":["music","lofi"],"ytTracks":["Xj1eP_z3JG4","DsCBSJe9ak0","3B5M8TyYpeg","5zqT6ZYwMFM","gNa8pOk1TWo","jotz-14DRUY","JJGjttUZnHM","NX_mkpaCQGo","TOsxBpYzSIo","hSlpokXTicg","aIHwSohCi3Q","XaRclToEnRU","u3QC4KuKWNU","xyU_ShY7hHM","IN4P99NGXEE","OItDbwk8kwY","gj-hnNANRc8","KZT2QKSzKtk","xHc65fEMmtI","SGAquT1Bp_A","LmkpHyfnRTc","LjKC_Vy_gAM","Q4GnveQx9Ek","smCJqm_OZ2k","GlwI0OM901o","28bwNoZn6Dc","i9OefASBqaw","NC0NwVMIIdg"],"ytSets":["XAID-7P_J2k","1Z9BD5B0EJo","NxSDNogkKX0","3FMdKH4r0Cc"]},{"id":"music/nujazz","name":"Nujazz","description":"Immerse yourself in the vibrant world of NuJazz with our insightful collection.\nUnveil key artists, must-listen tracks, innovative production tips, and the rich history of this dynamic genre. Ideal for enthusiasts and musicians.\n","tags":["music","nujazz"],"ytTracks":["jfFTT3iz740","XqDy1V7PM8s","d6e3NS99QUQ","aDBwgBWd_bI","ib6QOayO5iI","NAkpT29vWK8","FvcyZOVCORM","4fFgrcpUbEs","-ROLm9GkITU","Y4HWvsGs0rY","hnDXQXcgbCM","orZdl3KqgzU","YHcXoHbb2pE","qVbz4jFGFck","Uot4Ul5-p-g","mCsh6gUSW-k","e1p2S3HxwUo","7AjHIIjrC8E","l6oU080Gz5M","bpOpYVDhKTE","oj72JYbNP9M","W7v0X_QIShs","ZF3xipoI_AE","JQhjXXJpjlk","DY66nRSYa8E","OAQ10W8Clro","uyUBGQNP_MI","cHQ-oVSYkeU","PlJg6MkF8cg","H2H8BuFdMWQ","448-9wIYfAM","GgMlbsvqsNQ","RuW6OepFugU","zVqRENnc4gY","psjoPonCwQY","Ul8CE_U_p0Q","tn40-Z-PjAk","jsuBHVb7z2w","fcdHyceRq3k","lkP_0pLxWJ8","4w0L6Ol4Gms","xBHxBq1KjIo","Wk5wmxlu42c"],"ytSets":["WifI7lOUI-o"]},{"id":"music/odseza","name":"Odseza","description":"Odseza Collection\n","tags":["music","edm"],"ytTracks":["I2mK-Ql9r1Y","Sz_YPczxzZc","xarC5jAiO7w","HdzI-191xhU","wPqTCrm61-I","wuC1fHTnuJs","iLKoiq6Su-8","BEW_n1922vk","cwLRN5sdfnA","ypX5RiWRPIQ"],"ytSets":["Lb3oGU78GcM","MN98FGYo_5c","YyHLl-EnOIU"]},{"id":"music/shallou","name":"shallou","description":"Shallou Music Collection\n","tags":["music","chillstep"],"ytTracks":["wheZ0p65Gbo","1trifshoIw0","Lh8y6FEGL4k","a6cQBMbpEUI","0DZKc96T-RU","2ECgQTZojR4","c3gqG_vbjp8","KW7Mj97DkAE"],"ytSets":["AxMEfSW43kQ","mYMV2RXsTLc"]}]} | ||
{"items":[{"id":"music/ambient","name":"Ambient","description":"Discover the soothing world of ambient music, designed to evoke calm and emotions through immersive soundscapes, natural sounds, and evolving harmonies.\nPerfect for relaxation, meditation, and creating serene environments.\n","tags":["music","ambient"],"ytTracks":["WTsmIbNku5g","qz7tCZE_3wA","LaCd3YrEteE","9Jsbr8CTXKg","YPsjSWxm-LE","wxVc3-yYQ1Y","ScqB4PuOz0Q","-gfdvNwbw-0","PrFrS5HmPB0","pgHuG4JcYpk","91G8APy6lzc","UCjq5C62c3k","yoZPVMEsbeQ"],"ytSets":["vVkfxIlZFY0"]},{"id":"music/chillstep","name":"ChillStep","description":"ChillStep Collection\n","tags":["music","chillstep"],"ytTracks":["UOT8_5U7lLs","oHUlM6dcTXQ","KNf030fD5UY","yyqdG89zz58","o4RdwCeM-Kc","4fQeaM62mOY","_OTnxLtaFyA","wheZ0p65Gbo","1trifshoIw0","Lh8y6FEGL4k","a6cQBMbpEUI","0DZKc96T-RU","2ECgQTZojR4","c3gqG_vbjp8","KW7Mj97DkAE","zM0YGiaRfko","BJ1WADbGYIE","BA01rTCQ3Bk","1ty84eT-PAo"],"ytSets":["7TML_MTQdg4","AxMEfSW43kQ","mYMV2RXsTLc"]},{"id":"music/dnb","name":"Drum and Bass","description":"Shallou Music Collection\n","tags":["music","dnb"],"ytTracks":["S2TaAcwC_zI","rkjNL4dX-U4","aaQetOuCJf8","3eNCSxMYSrs","bE3Kvqyef_E","VGJlu7nlikY","CK3iO3F55BQ","7BmjVI712IE","yzf_pVGMNYo","hlRwWLiuNXc","uJkL1-s3PL8","zW2ZBUo-T6o","sz2-kugDhGE","rOdd20JHR40","9VmOLMV0U2w","6MnMjUxuOlA","2QvT07zAH8c","W4rnTAkMFWY","deTJ513J07Y","T7hlzIC6d-E","mlQX_MGA1gc","jjoos7UMfe4"],"ytSets":["Zy_JR9_Y8dE"]},{"id":"music/edm","name":"EDM","description":"Electronic Dance Movement\n","tags":["music","edm"],"ytTracks":["cSPfeTwl8Kw","YRrYClM0ly4","AhCfxBULO4w","0ZIyfw_M1Vc","FUdqnxUpaTk","ccz-kU20ExU","IQygUD54_ng","HH4TrLtfzMM","fAkmcZ3mshs","UFIoulOgprU","s8XIgR5OGJc","Yifz3X_i-F8","2XG_0iV2B40","ZeaIvjoH1FY","EsGiBwK4Ycc","d6azy4Ep_Os","E7BZwEgTOIM","_y8p6uQDH4s","zgI2K5hydX8","W0W1c_qH9sQ","MqsMZi087bc","WinkoZiOYQc","pBru4MPtEik","bcDr5Nw0Kfg","xXnyoFYNlGw","f1O6BY49APw","6lGV3l1WbLs","mDSm5dKnGnA","XqUZcHBsU5I","I2mK-Ql9r1Y","Sz_YPczxzZc","xarC5jAiO7w","HdzI-191xhU","wPqTCrm61-I","wuC1fHTnuJs","iLKoiq6Su-8","BEW_n1922vk","cwLRN5sdfnA","ypX5RiWRPIQ"],"ytSets":["IenNFcc6p4U","OPAy-sQQ7xU","Lb3oGU78GcM","MN98FGYo_5c","YyHLl-EnOIU"]},{"id":"music/electroswing","name":"Electro Swing","description":"Electro Swing\n","tags":["music","electroswing"],"ytTracks":["s1xv5eAppKo"],"ytSets":["CJgi8WEVh6k"]},{"id":"music/lofihiphop","name":"Lofi HipHop","description":"Delve into the captivating realm of lofi hip hop with our detailed guide.\nUnearth top artists, essential tracks, production techniques, and the intriguing history behind the genre's mellow beats.\nPerfect for fans and creators alike.\n","tags":["music","lofi"],"ytTracks":["Xj1eP_z3JG4","DsCBSJe9ak0","3B5M8TyYpeg","5zqT6ZYwMFM","gNa8pOk1TWo","jotz-14DRUY","JJGjttUZnHM","NX_mkpaCQGo","TOsxBpYzSIo","hSlpokXTicg","aIHwSohCi3Q","XaRclToEnRU","u3QC4KuKWNU","xyU_ShY7hHM","IN4P99NGXEE","OItDbwk8kwY","gj-hnNANRc8","KZT2QKSzKtk","xHc65fEMmtI","SGAquT1Bp_A","LmkpHyfnRTc","LjKC_Vy_gAM","Q4GnveQx9Ek","smCJqm_OZ2k","GlwI0OM901o","28bwNoZn6Dc","i9OefASBqaw","NC0NwVMIIdg"],"ytSets":["XAID-7P_J2k","1Z9BD5B0EJo","NxSDNogkKX0","3FMdKH4r0Cc"]},{"id":"music/nujazz","name":"Nujazz","description":"Immerse yourself in the vibrant world of NuJazz with our insightful collection.\nUnveil key artists, must-listen tracks, innovative production tips, and the rich history of this dynamic genre. Ideal for enthusiasts and musicians.\n","tags":["music","nujazz"],"ytTracks":["jfFTT3iz740","XqDy1V7PM8s","d6e3NS99QUQ","aDBwgBWd_bI","ib6QOayO5iI","NAkpT29vWK8","FvcyZOVCORM","4fFgrcpUbEs","-ROLm9GkITU","Y4HWvsGs0rY","hnDXQXcgbCM","orZdl3KqgzU","YHcXoHbb2pE","qVbz4jFGFck","Uot4Ul5-p-g","mCsh6gUSW-k","e1p2S3HxwUo","7AjHIIjrC8E","l6oU080Gz5M","bpOpYVDhKTE","oj72JYbNP9M","W7v0X_QIShs","ZF3xipoI_AE","JQhjXXJpjlk","DY66nRSYa8E","OAQ10W8Clro","uyUBGQNP_MI","cHQ-oVSYkeU","PlJg6MkF8cg","H2H8BuFdMWQ","448-9wIYfAM","GgMlbsvqsNQ","RuW6OepFugU","zVqRENnc4gY","psjoPonCwQY","Ul8CE_U_p0Q","tn40-Z-PjAk","jsuBHVb7z2w","fcdHyceRq3k","lkP_0pLxWJ8","4w0L6Ol4Gms","xBHxBq1KjIo","Wk5wmxlu42c","86ukyi4w6rY","_b99ARr8Zmk","qAnNPGUhOws","ojGwEt5e44A","kYu9GLhHme8"],"ytSets":["WifI7lOUI-o"]},{"id":"music/rock","name":"Rock","description":"Rock music, a genre marked by powerful backbeats and electric guitars, has shaped popular music since the 1950s.\nFrom legendary artists like The Beatles and Led Zeppelin to diverse subgenres like punk, hard rock, and alternative, Rock continues to influence and inspire.\n","tags":["music","rock"],"ytTracks":["pSDkjzZE74g"],"ytSets":["WiwWgN5O3WQ"]}]} |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
#!/bin/bash | ||
|
||
# Function to display usage | ||
usage() { | ||
echo "Usage: $0 --file=<filename without extension> --ytid=<youtube_tag> --title=<track_title>" | ||
exit 1 | ||
} | ||
|
||
# Function to update yt-tracks in the frontmatter | ||
update_frontmatter() { | ||
local input_file="$1" | ||
local youtube_tag="$2" | ||
|
||
# Read the entire file into a variable | ||
file_content=$(cat "$input_file") | ||
|
||
# Extract sections before yt-tracks, yt-tracks, and after yt-tracks | ||
before_yt_tracks=$(echo "$file_content" | awk '/yt-tracks:/ {exit} {print}') | ||
yt_tracks=$(echo "$file_content" | awk '/yt-tracks:/,/yt-sets:/ {print}' | grep -v "yt-tracks:" | grep -v "yt-sets:") | ||
after_yt_tracks=$(echo "$file_content" | awk '/yt-sets:/, 0 {print}') | ||
|
||
# Check if the YouTube tag already exists in yt-tracks | ||
if echo "$yt_tracks" | grep -q " - $youtube_tag"; then | ||
echo "The YouTube tag $youtube_tag already exists in yt-tracks. No changes made." | ||
return 1 | ||
fi | ||
|
||
# Append the new YouTube tag to the yt-tracks section | ||
yt_tracks="$yt_tracks\n - $youtube_tag" | ||
|
||
# Create the updated content | ||
updated_content="$before_yt_tracks\nyt-tracks:\n$yt_tracks\n$after_yt_tracks" | ||
|
||
# Write the updated content back to the file | ||
echo -e "$updated_content" > "$input_file" | ||
|
||
echo "YouTube tag has been added to the frontmatter successfully." | ||
return 0 | ||
} | ||
|
||
# Function to escape markdown special characters | ||
escape_markdown() { | ||
echo "$1" | sed -e 's/\\/\\\\/g' -e 's/\*/\\*/g' -e 's/_/\\_/g' -e 's/|/\\|/g' -e 's/\[/\\[/g' -e 's/\]/\\]/g' -e 's/(/\\(/g' -e 's/)/\\)/g' -e 's/#/\\#/g' -e 's/+/\\+/g' -e 's/-/\\-/g' -e 's/!/\\!/g' -e 's/\./\\./g' | ||
} | ||
|
||
# Function to update the TrackList section | ||
update_tracklist() { | ||
local input_file="$1" | ||
local youtube_tag="$2" | ||
local track_title="$3" | ||
|
||
# Escape markdown special characters in the track title | ||
escaped_track_title=$(escape_markdown "$track_title") | ||
escaped_yt_id=$(escape_markdown "$youtube_tag") | ||
|
||
# Check if the YouTube tag already exists in the TrackList | ||
if grep -q "| $escaped_yt_id |" "$input_file"; then | ||
echo "The YouTube tag $escaped_yt_id already exists in the TrackList. No changes made." | ||
return 1 | ||
fi | ||
|
||
# Use a temporary file for sed operations to ensure compatibility | ||
tmp_file=$(mktemp) | ||
new_track_entry="| $escaped_track_title | $escaped_yt_id | [Play Track ID $escaped_yt_id](https://kbve.com/music/?yt=$youtube_tag) |" | ||
|
||
# Add the new track entry to the TrackList table using sed | ||
sed "/## TrackList/,/^## /{/^| ---/a\\ | ||
$new_track_entry | ||
}" "$input_file" > "$tmp_file" | ||
|
||
# Move the temporary file to the original file | ||
mv "$tmp_file" "$input_file" | ||
|
||
echo "YouTube tag and track title have been added to the TrackList successfully." | ||
return 0 | ||
} | ||
|
||
# Parse arguments | ||
for arg in "$@"; do | ||
case $arg in | ||
--file=*) | ||
file_name="${arg#*=}" | ||
shift | ||
;; | ||
--ytid=*) | ||
youtube_tag="${arg#*=}" | ||
shift | ||
;; | ||
--title=*) | ||
track_title="${arg#*=}" | ||
shift | ||
;; | ||
*) | ||
usage | ||
;; | ||
esac | ||
done | ||
|
||
# Check if all required arguments are provided | ||
if [ -z "$file_name" ] || [ -z "$youtube_tag" ] || [ -z "$track_title" ]; then | ||
usage | ||
fi | ||
|
||
input_file="./apps/kbve.com/src/content/docs/music/${file_name}.mdx" | ||
|
||
# Check if the file exists | ||
if [ ! -f "$input_file" ]; then | ||
echo "File $input_file does not exist." | ||
exit 1 | ||
fi | ||
|
||
# Update yt-tracks in the frontmatter | ||
update_frontmatter "$input_file" "$youtube_tag" | ||
if [ $? -ne 0 ]; then | ||
exit 1 | ||
fi | ||
|
||
# Update the TrackList section | ||
update_tracklist "$input_file" "$youtube_tag" "$track_title" | ||
if [ $? -ne 0 ]; then | ||
exit 1 | ||
fi |