From 56f477f6de45a675d0d9103b547ef0989ea622c0 Mon Sep 17 00:00:00 2001 From: nelsonlaquet Date: Wed, 28 May 2014 02:22:34 -0500 Subject: [PATCH] Updated API per Silver's requirements --- .../2014_05_28_071738_update_track_hash.php | 15 +++++++++++++++ app/models/Entities/Track.php | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 app/database/migrations/2014_05_28_071738_update_track_hash.php diff --git a/app/database/migrations/2014_05_28_071738_update_track_hash.php b/app/database/migrations/2014_05_28_071738_update_track_hash.php new file mode 100644 index 00000000..27dc992a --- /dev/null +++ b/app/database/migrations/2014_05_28_071738_update_track_hash.php @@ -0,0 +1,15 @@ +get() as $track) { + $track->updateHash(); + $track->save(); + } + } + + public function down() { + } +} \ No newline at end of file diff --git a/app/models/Entities/Track.php b/app/models/Entities/Track.php index d0eeb4ec..af063b1e 100644 --- a/app/models/Entities/Track.php +++ b/app/models/Entities/Track.php @@ -420,7 +420,7 @@ } public function updateHash() { - $this->hash = md5(Helpers::sanitizeInputForHashing($this->user->display_name) . '-' . Helpers::sanitizeInputForHashing($this->title)); + $this->hash = md5(Helpers::sanitizeInputForHashing($this->user->display_name) . ' - ' . Helpers::sanitizeInputForHashing($this->title)); } public function updateTags() {