Permalink
Browse files

Merge branch 'master' of github.com:comotion/hangover

  • Loading branch information...
2 parents 6b93ae0 + 3474e98 commit de30f6a3311a8d2d1f60667f0f5109db0a491f94 @krav krav committed Nov 19, 2012
Showing with 25 additions and 9 deletions.
  1. +3 −0 .gitmodules
  2. +8 −0 TODO
  3. +2 −0 web/config.lua
  4. +5 −4 web/hangover.lua
  5. +1 −1 web/lib/tokyo.lua
  6. +1 −0 web/lib/tokyotyrant
  7. +5 −4 web/lib/tracks.lua
View
@@ -1,3 +1,6 @@
[submodule "web/lib/lamt"]
path = web/lib/lamt
url = git://github.com/comotion/lamt.git
+[submodule "web/lib/tokyotyrant"]
+ path = web/lib/tokyotyrant
+ url = https://github.com/daurnimator/lua-tokyotyrant.git
View
8 TODO
@@ -5,6 +5,14 @@ What to do and how:
+ empty searches?! ::
+ getracks 01.fuck yuo
+ empty upload fucks up
++ get nonexistant track fucks up
+
+wishlist:
+ - edit page
+ - error messages
+ - (add to .. ) playlist builder
+ - create program dialog (with sched picker)
+ - delete track/playlist track/playlist/
- get_next:
knows about silences, metadata, can queue songs
View
@@ -10,3 +10,5 @@ tracks_path = "/tmp/mu"
-- must be on same device as tracks_path, or error: "invalid cross-device link"
temp_dir = "/tmp"
+-- database host, port
+--host,port = ('localhost',1978)
View
@@ -57,11 +57,12 @@ function get_db(web,...)
local result, size = tracks:search(query, qf)
local pages = math.floor(size/limit)+1
+ print('got query: '.. u.dump(web.GET).. ' result: '.. u.dump(result))
+
if fields then
fields = u.split(fields)
- else
- fields = tracks.fields(result);
end
+ print("splitting fields: "..u.dump(fields))
result = tracks.filter(result, fields, limit, skip)
return json.encode({{fields=fields,pages=pages,result=result}}).."\n"
end
@@ -143,8 +144,8 @@ function put_db(web,...)
local id = ...
local input = web.input.post_data
u.out(input)
- if input then
- input = json.decode(input)
+ if not input then
+ return json.encode{{result=nil, error="nothing to put"}}
end
return tracks:update(id, input)
end
View
@@ -7,7 +7,7 @@ local u = require "lib/util"
module("tokyo", package.seeall)
function tokyo:init(name)
- local file = name .. ".tch"
+ local file = name .. ".tct"
-- fix this stupidity. if you spell the query type wrong,
-- you get no warnings, nothing.
Submodule tokyotyrant added at 3841dd
View
@@ -194,19 +194,20 @@ function tracks.filter(result, fields, limit, skip)
break
end
if(c > skip) then
- if #fields == 0 then
- one = v
+ if not fields or #fields == 0 then
+ one = v -- no fields, so all fields
else
local one = {}
for i,f in pairs(fields) do
- one[f] = v[f]
+ one[f] = v[f] -- just these fields
end
end
res[k] = one
end
end
return res
end
-u.out("fapfapfap", tracks:dump())
+u.out("fapfapfap")
+u.out(tracks:dump())
return tracks

0 comments on commit de30f6a

Please sign in to comment.