Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

lua evals if 0 as true

  • Loading branch information...
commit 5312e19567bbf8f41b28ecb85bf7cd4c2b171078 1 parent 2f255c9
@comotion authored
Showing with 11 additions and 4 deletions.
  1. +3 −2 TODO
  2. +8 −2 web/lib/tracks.lua
View
5 TODO
@@ -1,9 +1,10 @@
What to do and how:
-+ file upload fucks up!
-+ empty searches
++ file upload fucks up!:: b/c tracks_path doesnt exist
++ empty searches?! ::
+ getracks 01.fuck yuo
++ empty upload fucks up
- get_next:
knows about silences, metadata, can queue songs
View
10 web/lib/tracks.lua
@@ -42,11 +42,17 @@ function tracks:add(cols)
local pkey = trk:genuid()
cols.added = os.time()
cols.station = cols.station or default_station
+ print("adding ".. u.dump(cols))
if cols.md5 then
id = tracks:ssearch({md5=md5})
- if id then return id end
+ if #id ~= 0 then
+ print("found id "..u.dump(id))
+ return id
+ end
end
- return tracks:put(pkey, cols)
+ id = tracks:put(pkey, cols)
+ print("the id added wasy: "..id)
+ return id
end
-- the simple search
Please sign in to comment.
Something went wrong with that request. Please try again.