Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27056fa
commit 2961a5b
Showing
13 changed files
with
231 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.0.3 | ||
0.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
session_start(); | ||
|
||
if (isset($_SESSION['username'])) { | ||
if(isset($_GET['set']) && isset($_GET['value'])) { | ||
switch($_GET['set']) { | ||
case "volume": | ||
$_SESSION['volume'] = $_GET['value']; | ||
exit; | ||
} | ||
} | ||
|
||
if(isset($_GET['get']) && isset($_GET['value'])) { | ||
switch($_GET['get']) { | ||
case "volume": | ||
return $_SESSION['volume']; | ||
exit; | ||
} | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
CREATE PROCEDURE `InsertUpdateTrack`(`insert_track` TEXT, `insert_album` TEXT, `insert_artist` TEXT, `insert_path` TEXT, `insert_track_number` INT, `insert_cover` TEXT) | ||
|
||
BEGIN | ||
|
||
DECLARE artist_check INT; | ||
DECLARE album_check INT; | ||
DECLARE track_check INT; | ||
|
||
SELECT id INTO artist_check FROM artist ar | ||
WHERE ar.title = insert_artist | ||
LIMIT 1; | ||
|
||
SELECT al.id INTO album_check FROM album al | ||
INNER JOIN artist ar ON al.artist_id = ar.id | ||
WHERE ar.title = insert_artist | ||
AND al.title = insert_album | ||
LIMIT 1; | ||
|
||
SELECT t.id INTO track_check FROM track t | ||
WHERE t.path = insert_path | ||
LIMIT 1; | ||
|
||
IF artist_check IS NULL THEN | ||
INSERT INTO artist (title) VALUES (insert_artist); | ||
SELECT LAST_INSERT_ID() INTO artist_check; | ||
END IF; | ||
IF album_check IS NULL THEN | ||
INSERT INTO album (title, artist_id) VALUES (insert_album, artist_check); | ||
SELECT LAST_INSERT_ID() INTO album_check; | ||
END IF; | ||
|
||
|
||
IF track_check IS NOT NULL THEN | ||
/* update if track already exists */ | ||
UPDATE track SET title = insert_track, artist_id = artist_check, album_id = album_check, path = insert_path, track_number = insert_track_number, cover = insert_cover | ||
WHERE id = track_check; | ||
ELSE | ||
/* insert new track */ | ||
INSERT INTO track (title, artist_id, album_id, path, track_number, cover) | ||
VALUES (insert_track, artist_check, album_check, insert_path, insert_track_number, insert_cover); | ||
END IF; | ||
|
||
END; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CREATE PROCEDURE `PurgeAlbumArtist`() | ||
|
||
BEGIN | ||
|
||
/* purge albums with no tracks anymore */ | ||
DELETE a FROM album a | ||
JOIN ( | ||
SELECT al.id AS 'id' FROM album al | ||
LEFT JOIN track t on t.album_id = al.id | ||
GROUP BY al.id | ||
HAVING count(t.id) = 0 | ||
) del ON a.id = del.id; | ||
|
||
/* purge artists with no albums anymore */ | ||
DELETE a FROM artist a | ||
JOIN ( | ||
SELECT ar.id AS 'id' FROM artist ar | ||
LEFT JOIN album al on al.artist_id = ar.id | ||
GROUP BY ar.id | ||
HAVING count(al.id) = 0 | ||
) del ON a.id = del.id; | ||
|
||
END; |
Oops, something went wrong.