diff --git a/pixelapi/list.go b/pixelapi/list.go
index a75e8ac..6b099d9 100644
--- a/pixelapi/list.go
+++ b/pixelapi/list.go
@@ -1,5 +1,7 @@
package pixelapi
+import "time"
+
// API error constants
const (
ListNotFoundError = "list_not_found"
@@ -7,22 +9,23 @@ const (
// List information object from the pixeldrain API
type List struct {
- Success bool `json:"success"`
- ID string `json:"id"`
- Title string `json:"title"`
- DateCreated int64 `json:"date_created"`
+ Success bool `json:"success"`
+ ID string `json:"id"`
+ Title string `json:"title"`
+ DateCreated time.Time `json:"date_created"`
+ FileCount int `json:"file_count"`
Files []ListFile
}
// ListFile information object from the pixeldrain API
type ListFile struct {
- ID string `json:"id"`
- DetailHREF string `json:"detail_href"`
- FileName string `json:"file_name"`
- Description string `json:"description"`
- DateCreated int64 `json:"date_created"`
- DateLastView int64 `json:"date_last_view"`
- ListDescription string `json:"list_description"`
+ ID string `json:"id"`
+ DetailHREF string `json:"detail_href"`
+ FileName string `json:"file_name"`
+ Description string `json:"description"`
+ DateCreated time.Time `json:"date_created"`
+ DateLastView time.Time `json:"date_last_view"`
+ ListDescription string `json:"list_description"`
}
// GetList get a List from the pixeldrain API. Errors will be available through
diff --git a/pixelapi/pixelapi.go b/pixelapi/pixelapi.go
index cc52de0..5271cd8 100644
--- a/pixelapi/pixelapi.go
+++ b/pixelapi/pixelapi.go
@@ -48,7 +48,7 @@ type SuccessResponse struct {
func (p *PixelAPI) jsonRequest(method, url string, target interface{}) error {
req, err := http.NewRequest(method, url, nil)
if err != nil {
- return &Error{
+ return Error{
ReqError: true,
Success: false,
Value: err.Error(),
@@ -62,7 +62,7 @@ func (p *PixelAPI) jsonRequest(method, url string, target interface{}) error {
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
- return &Error{
+ return Error{
ReqError: true,
Success: false,
Value: err.Error(),
diff --git a/pixelapi/user.go b/pixelapi/user.go
index f2e92e4..d08e23a 100644
--- a/pixelapi/user.go
+++ b/pixelapi/user.go
@@ -79,3 +79,21 @@ func (p *PixelAPI) UserFiles(page, limit int) (resp *UserFiles, err error) {
}
return resp, nil
}
+
+type UserLists struct {
+ Success bool `json:"success"`
+ Lists []List `json:"lists"`
+}
+
+func (p *PixelAPI) UserLists(page, limit int) (resp *UserLists, err error) {
+ resp = &UserLists{Lists: make([]List, 0)}
+ err = p.jsonRequest(
+ "GET",
+ fmt.Sprintf("%s/user/lists?page=%d&limit=%d", p.apiEndpoint, page, limit),
+ resp,
+ )
+ if err != nil {
+ return nil, err
+ }
+ return resp, nil
+}
diff --git a/res/static/res/img/icon_list.png b/res/static/res/img/icon_list.png
new file mode 100644
index 0000000..afeda44
Binary files /dev/null and b/res/static/res/img/icon_list.png differ
diff --git a/res/template/account/user_files.html b/res/template/account/user_files.html
index 322aaf7..00b696e 100644
--- a/res/template/account/user_files.html
+++ b/res/template/account/user_files.html
@@ -20,7 +20,7 @@
{{.FileName}}
- {{.DateUpload}}
+ {{.DateUpload.Format "2006-01-02 15:04:05"}}
{{end}}
diff --git a/res/template/account/user_home.html b/res/template/account/user_home.html
index 4d4f602..930f035 100644
--- a/res/template/account/user_home.html
+++ b/res/template/account/user_home.html
@@ -18,12 +18,27 @@
{{.FileName}}
- {{.DateUpload}}
+ {{.DateUpload.Format "2006-01-02 15:04:05"}}
{{end}}
...All my files
+
+