More updates :)
Former-commit-id: cc9953eaa75e9c68abc19b40cf1c4391f1c5fe24 [formerly b553106eb6a4f00474c7c79f74c02ae475e9601c] [formerly 39ca855c5e0788008f5c671164fb6e404a31aaa0 [formerly 76de8e59407a3b80bbba0425655104b47a7bfde6]] Former-commit-id: 0c1a5f9cc633e40506f54d9da1420ae7c183bc88 [formerly 061569610df0c6e41830bf27516ef567c3a83c55] Former-commit-id: b400af585254eba659078ea1f5f48609930c4ea6
This commit is contained in:
@@ -2,6 +2,7 @@ package bolt
|
||||
|
||||
import (
|
||||
"github.com/asdine/storm"
|
||||
"github.com/asdine/storm/q"
|
||||
fm "github.com/hacdias/filemanager"
|
||||
)
|
||||
|
||||
@@ -19,6 +20,16 @@ func (s ShareStore) Get(hash string) (*fm.ShareLink, error) {
|
||||
return v, err
|
||||
}
|
||||
|
||||
func (s ShareStore) GetPermanent(path string) (*fm.ShareLink, error) {
|
||||
var v *fm.ShareLink
|
||||
err := s.DB.Select(q.Eq("Path", path), q.Eq("Expires", false)).First(&v)
|
||||
if err == storm.ErrNotFound {
|
||||
return v, fm.ErrNotExist
|
||||
}
|
||||
|
||||
return v, err
|
||||
}
|
||||
|
||||
func (s ShareStore) GetByPath(hash string) ([]*fm.ShareLink, error) {
|
||||
var v []*fm.ShareLink
|
||||
err := s.DB.Find("Path", hash, &v)
|
||||
|
||||
Reference in New Issue
Block a user