Documentation ¶
Index ¶
- func AuthUpload(r *http.Request) bool
- func FailWithCode(w http.ResponseWriter, r *http.Request, status int, logr *log.Logger)
- func Hash(password, salt string) string
- func PathNotExists(apath string) bool
- func RandName(length uint) string
- func SaveAlbumCover(albumid int, meta *AlbumMeta, folderPath string) error
- func SaveSongs(firstSongID int, meta *AlbumMeta, folderPath string) (err error)
- func Unzip(r *zip.ReadCloser, dest string) (filenames []string, err error)
- type AlbumMeta
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthUpload ¶
AuthUpload uses Hash function to validate upload password.
func FailWithCode ¶
FailWithCode is used to appropriately respond to user in an event of failure. It uses status parameter to figure out what exactly to send back.
func SaveAlbumCover ¶
SaveAlbumCover moves album cover from newly extracted album into its proper location within the config.AlbumsFolder.
Types ¶
type AlbumMeta ¶
type AlbumMeta struct { Album string `json:"album"` Artist string `json:"artist"` CoverExt string `json:"coverext"` Genres []string `json:"genres"` Songs []struct { Feat []string `json:"feat"` Song string `json:"song"` AudioExt string `json:"audioext"` } `json:"songs"` }
AlbumMeta contains album metadata.
func ReadAlbumMeta ¶
ReadAlbumMeta returns album metadata read from "meta.json" file. It expects a string path to the folder that contains album files.
Click to show internal directories.
Click to hide internal directories.