AXCWG пре 2 месеци
родитељ
комит
246f453cfb
6 измењених фајлова са 70 додато и 18 уклоњено
  1. 2 2
      .idea/dataSources.xml
  2. 42 15
      README.md
  3. 17 0
      UserInteractions.js
  4. 1 1
      main.js
  5. 7 0
      package-lock.json
  6. 1 0
      package.json

+ 2 - 2
.idea/dataSources.xml

@@ -1,11 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="DataSourceManagerImpl" format="xml" multifile-model="true">
-    <data-source source="LOCAL" name="@8.141.5.12" uuid="d06398b7-49f6-46ef-acd8-28d6def335d4">
+    <data-source source="LOCAL" name="@andyxie.cn" uuid="d06398b7-49f6-46ef-acd8-28d6def335d4">
       <driver-ref>mysql.8</driver-ref>
       <synchronize>true</synchronize>
       <jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
-      <jdbc-url>jdbc:mysql://8.141.5.12:3306</jdbc-url>
+      <jdbc-url>jdbc:mysql://andyxie.cn:3306</jdbc-url>
       <working-dir>$ProjectFileDir$</working-dir>
     </data-source>
   </component>

+ 42 - 15
README.md

@@ -6,23 +6,50 @@ Not aimed for public. Classified documents contained.
 ## Specification 
     Specification 1.0 for InstruNet
     
+    - DB
+        Column:
+            uuid - Unique ID per entry
+            song_name - Stands for the name of the song of the entry
+            album_name - Stands for the name of the album of the entry
+            link_to - Stands for the metadata information of the entry
+            databinary - Stands for the binary data of the entry
+            artist - Stands for the artist for the entry
+            kind - Describes the kind of the entry.
+            albumcover - Binary data for album cover. 
+        kind (enum) :
+        0 - Full removal of vocal
+        1 - Karaoke--keeps the harmony
+        2 - vocal only (Not yet implemented) 
+        3 - bass
+        4 - drums
+        5 - others
+
+
+## Specification for Playlist
+
+    Specification 0.1 for InstruNet.Playlist System
+    
     - DB
     Column:
-    uuid - Unique ID per entry
-    song_name - Stands for the name of the song of the entry
-    album_name - Stands for the name of the album of the entry
-    link_to - Stands for the metadata information of the entry
-    databinary - Stands for the binary data of the entry
-    artist - Stands for the artist for the entry
-    kind - Describes the kind of the entry.
-    albumcover - Binary data for album cover. 
-    kind (enum) :
-    0 - Full removal of vocal
-    1 - Karaoke--keeps the harmony
-    2 - vocal only (Not yet implemented) 
-    3 - bass
-    4 - drums
-    5 - others
+    owner - Owner of the playlist
+    uuid - uuid of the playlist
+    content - Content of the playlist -- Songs and shit.
+        Object.
+    
+    private - Enum, whether private or not.
+        0 - Public
+        1 - Private
+    tmb - Thumbnail
+    title: Title of the playlist. 
+
+## Specification for Playlist.content 0.1
+```javascript
+[
+  uuid // uuid of the song
+]
+```
+
+
 
 
 ## TODO 

+ 17 - 0
UserInteractions.js

@@ -97,6 +97,23 @@ export default function UserInteractions(opts) {
 
         }
 
+    })
+    app.post("/playlist", async function (req, res) {
+        if (!req.session.uuid) {
+            res.set(cwh).status(500).json({code: 500, R: "AD"})
+            return;
+        }
+        db.execute("SELECT title, tmb, content from playlist where uuid = ?", [req.session.uuid], function (err, result) {
+            if (err) {
+                console.log(err);
+                res.set(cwh).status(500).json({code: 500, R: "AD"})
+                return;
+            }
+            res.set(cwh).end(JSON.stringify(result));
+
+        })
+
+
     })
     app.post("/register", function (req, res) {
         db.execute("SELECT uuid FROM user WHERE username = ?", [req.body.username], async function (err, rows) {

+ 1 - 1
main.js

@@ -247,7 +247,7 @@ async function Submit(req) {
     } catch (e) {
         GC()
         console.error(e)
-        return
+        
     }
 
 

+ 7 - 0
package-lock.json

@@ -30,6 +30,7 @@
         "send-seekable": "^1.0.4",
         "sort-array": "^5.0.0",
         "sqlite3": "^5.1.7",
+        "wav-encoder": "^1.3.0",
         "webp-converter": "^2.3.3",
         "webp-converter-browser": "^1.0.4",
         "ws": "^8.18.0"
@@ -3004,6 +3005,12 @@
         "node": ">= 0.8"
       }
     },
+    "node_modules/wav-encoder": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/wav-encoder/-/wav-encoder-1.3.0.tgz",
+      "integrity": "sha512-FXJdEu2qDOI+wbVYZpu21CS1vPEg5NaxNskBr4SaULpOJMrLE6xkH8dECa7PiS+ZoeyvP7GllWUAxPN3AvFSEw==",
+      "license": "MIT"
+    },
     "node_modules/webidl-conversions": {
       "version": "3.0.1",
       "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",

+ 1 - 0
package.json

@@ -34,6 +34,7 @@
     "send-seekable": "^1.0.4",
     "sort-array": "^5.0.0",
     "sqlite3": "^5.1.7",
+    "wav-encoder": "^1.3.0",
     "webp-converter": "^2.3.3",
     "webp-converter-browser": "^1.0.4",
     "ws": "^8.18.0"