Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit de30f6a3311a8d2d1f60667f0f5109db0a491f94 2 parents 6b93ae0 + 3474e98
@krav krav authored
View
3  .gitmodules
@@ -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
2  web/config.lua
@@ -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
9 web/hangover.lua
@@ -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
2  web/lib/tokyo.lua
@@ -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.
1  web/lib/tokyotyrant
@@ -0,0 +1 @@
+Subproject commit 3841dd55246b9f459e1b6d38aaa1db785bb1cb01
View
9 web/lib/tracks.lua
@@ -194,12 +194,12 @@ 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
@@ -207,6 +207,7 @@ function tracks.filter(result, fields, limit, skip)
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.
Something went wrong with that request. Please try again.