funkwhale

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright © 2023 Philipp Wolfer <phw@uploadedlobster.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Copyright © 2023 Philipp Wolfer <phw@uploadedlobster.com>

This file is part of Scotty.

Scotty is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Scotty is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Scotty. If not, see <https://www.gnu.org/licenses/>.

Copyright © 2023 Philipp Wolfer <phw@uploadedlobster.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Index

Constants

View Source
const FunkwhaleClientName = "Funkwhale"
View Source
const MaxItemsPerGet = 50

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	Id          int    `json:"int"`
	Title       string `json:"title"`
	AlbumArtist Artist `json:"artist"`
	ReleaseDate string `json:"release_date"`
	TrackCount  int    `json:"track_count"`
	ReleaseMbid string `json:"mbid"`
}

type Artist

type Artist struct {
	Id         int    `json:"int"`
	Name       string `json:"name"`
	ArtistMbid string `json:"mbid"`
}

type Client

type Client struct {
	HttpClient *resty.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(serverUrl string, token string) Client

func (Client) GetFavoriteTracks

func (c Client) GetFavoriteTracks(page int, perPage int) (result FavoriteTracksResult, err error)

func (Client) GetHistoryListenings

func (c Client) GetHistoryListenings(user string, page int, perPage int) (result ListeningsResult, err error)

type FavoriteTrack

type FavoriteTrack struct {
	Id           int    `json:"int"`
	User         User   `json:"user"`
	Track        Track  `json:"track"`
	CreationDate string `json:"creation_date"`
}

func (FavoriteTrack) AsLove

func (f FavoriteTrack) AsLove() models.Love

type FavoriteTracksResult

type FavoriteTracksResult struct {
	Count    int             `json:"count"`
	Previous string          `json:"previous"`
	Next     string          `json:"next"`
	Results  []FavoriteTrack `json:"results"`
}

type FunkwhaleApiBackend

type FunkwhaleApiBackend struct {
	// contains filtered or unexported fields
}

func (*FunkwhaleApiBackend) ExportListens

func (b *FunkwhaleApiBackend) ExportListens(oldestTimestamp time.Time, results chan models.ListensResult, progress chan models.Progress)

func (*FunkwhaleApiBackend) ExportLoves

func (b *FunkwhaleApiBackend) ExportLoves(oldestTimestamp time.Time, results chan models.LovesResult, progress chan models.Progress)

func (*FunkwhaleApiBackend) FromConfig

func (b *FunkwhaleApiBackend) FromConfig(config *config.ServiceConfig) models.Backend

func (*FunkwhaleApiBackend) Name

func (b *FunkwhaleApiBackend) Name() string

func (*FunkwhaleApiBackend) Options added in v0.3.0

func (b *FunkwhaleApiBackend) Options() []models.BackendOption

type Listening

type Listening struct {
	Id           int    `json:"int"`
	User         User   `json:"user"`
	Track        Track  `json:"track"`
	CreationDate string `json:"creation_date"`
}

func (Listening) AsListen

func (l Listening) AsListen() models.Listen

type ListeningsResult

type ListeningsResult struct {
	Count    int         `json:"count"`
	Previous string      `json:"previous"`
	Next     string      `json:"next"`
	Results  []Listening `json:"results"`
}

type Track

type Track struct {
	Id            int      `json:"int"`
	Artist        Artist   `json:"artist"`
	Album         Album    `json:"album"`
	Title         string   `json:"title"`
	Position      int      `json:"position"`
	DiscNumber    int      `json:"disc_number"`
	RecordingMbid string   `json:"mbid"`
	Tags          []string `json:"tags"`
	Uploads       []Upload `json:"uploads"`
}

func (Track) AsTrack

func (t Track) AsTrack() models.Track

type Upload

type Upload struct {
	UUID     string `json:"uuid"`
	Duration int    `json:"duration"`
}

type User

type User struct {
	Id       int    `json:"int"`
	UserName string `json:"username"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL