Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

teh fix0rz

  • Loading branch information...
commit 2f255c952f1b4d523588edf250b2e6c3db13fd2c 1 parent 7f25319
@comotion authored
Showing with 34 additions and 5 deletions.
  1. +4 −0 TODO
  2. +8 −2 web/hangover.lua
  3. +1 −1  web/lib/lamt
  4. +21 −2 web/lib/program.lua
View
4 TODO
@@ -1,6 +1,10 @@
What to do and how:
++ file upload fucks up!
++ empty searches
++ getracks 01.fuck yuo
+
- get_next:
knows about silences, metadata, can queue songs
knows about shows & jingles
View
10 web/hangover.lua
@@ -74,7 +74,7 @@ function getfile(file)
-- XXX: mayhap we shouldn't accept anything other than audio/?
t.contenttype = string.gsub(string.gsub(file['content-type'], "audio",""), "/","")
t.extension = file.name:gmatch(".(%w+)$")()
- local dest,tname = u.open_temp_file(temp_dir.."/hangover_up@@@")
+ local dest, tname = u.open_temp_file(temp_dir.."/hangover_up@@@")
local bytes = file.contents
if not dest then
return nil,json.encode{{status="fail",reason="bad tempfile, baad"}}
@@ -85,13 +85,16 @@ function getfile(file)
print("["..os.date("%c", t.submitted).. "] '"..t.filename.."' -> "..tname)
print("'"..t.filename .. "'".." " .. os.difftime(os.time(), t.submitted).."s")
t.md5 = crypto.digest("md5", bytes)
- local destname = t.md5..t.extension-- krav's pathless filename
+ local destname = t.md5..'.'..t.extension-- krav's pathless filename
t.path = tracks_path .. "/" .. destname
+ print("now moving ... ".. tname .. ' path: '..t.path)
+ os.execute('mkdir -p '..tracks_path)
local rc, err = os.rename(tname, t.path)
if not rc then
return nil, json.encode{{status="fail", reason=err}}
end
print("'"..destname.. "'".." " .. os.difftime(os.time(), t.submitted).."s")
+ print(u.dump(t));
return t
end
@@ -102,6 +105,9 @@ function post_db(web,...)
local id, file = web.POST.id, web.POST.file
if file then -- someone is uploading a mix
t, some = getfile(file)
+ if not t then
+ return some
+ end
-- attempt id3 extraction / file metadata
tags, failure = meta.gettags(t.path, t)
if not tags then
2  web/lib/lamt
@@ -1 +1 @@
-Subproject commit 1c6f6e3539d45d5064a62cf153579492bcdccff7
+Subproject commit 6a27728f467734415db8017ae5b2e43a00da09d4
View
23 web/lib/program.lua
@@ -13,8 +13,9 @@
-- { id, name, [selector, playlist]}
require "os"
require "math"
-local db = require "lib.tokyo"
-local u = require "lib.util"
+local db = require "lib.tokyo"
+--local tracks = require "lib.tracks"
+local u = require "lib.util"
module("program", package.seeall)
@@ -23,6 +24,24 @@ function program:init()
end
prg = program:init()
+program = {
+ name = "zonkas kronkas",
+ start = 123556127,
+ time = '12:45',
+ day = "sunday",
+ duration = '60 minutes',
+ recur = 'weekly',
+ stop = 133377777,
+ selector = { artist='mama', mood='evening' },
+ selector = "zabu cronik",
+ playlist = { 1, 3, 4, 10, 42 },
+}
+
+
+function selector(search)
+end
+
+
function program:put(pkey,cols)
return tokyo:put(prg,pkey,cols)
end
Please sign in to comment.
Something went wrong with that request. Please try again.