From a8edbc7d3cdb89debc6d99d9a348c8f8d8c97501 Mon Sep 17 00:00:00 2001
From: SinTan1729 <sayantan.santra689@gmail.com>
Date: Mon, 20 Jan 2025 16:41:42 -0600
Subject: [PATCH] new: Added script fix-flac-date

---
 README.md        |  2 +-
 fix-flac-date.sh | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 fix-flac-date.sh

diff --git a/README.md b/README.md
index 46b78aa..95ed0a8 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-![Number of scripts](https://img.shields.io/badge/number_of_scripts-46-blue)
+![Number of scripts](https://img.shields.io/badge/number_of_scripts-47-blue)
 # Random Scripts
 This repository is for random scripts I wrote mostly for personal use.
 
diff --git a/fix-flac-date.sh b/fix-flac-date.sh
new file mode 100644
index 0000000..596b963
--- /dev/null
+++ b/fix-flac-date.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+# This script changes the DATE of a flac to be the
+# one passed as the first argument.
+# The name of the file should be passed as the second argument.
+
+DATE=$1
+FILE="$2"
+
+[ -z "$DATE" ] && echo "Please provide a date" && exit -1
+! [ -f "$FILE" ] && echo "Please provide a valid file" && exit -2
+
+metaflac --remove-tag=YEAR "$FILE"
+metaflac --remove-tag=DATE "$FILE"
+metaflac --set-tag="DATE=$DATE" "$FILE"
+
+echo "Done!"
+