repository

package
v0.0.0-...-94305fe Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MediaRepository

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

func NewMediaRepository

func NewMediaRepository(db *gorm.DB) *MediaRepository

func (*MediaRepository) AddMovieComment

func (r *MediaRepository) AddMovieComment(userID string, movieID int, content string) (*repository.MovieComment, error)

AddMovieComment adds a comment to a movie

func (*MediaRepository) AddTvShowComment

func (r *MediaRepository) AddTvShowComment(userID string, tvShowID int, content string) (*repository.TvShowComment, error)

AddTvShowComment adds a comment to a tv show

func (*MediaRepository) AvailableEpisodes

func (r *MediaRepository) AvailableEpisodes(tvShowID int) (*[]int, error)

func (*MediaRepository) CountAvailableEpisodes

func (r *MediaRepository) CountAvailableEpisodes() (int64, error)

func (*MediaRepository) CountAvailableMovies

func (r *MediaRepository) CountAvailableMovies() (int64, error)

func (*MediaRepository) CountAvailableTvShows

func (r *MediaRepository) CountAvailableTvShows() (int64, error)

func (*MediaRepository) CountEpisodesTotalDuration

func (r *MediaRepository) CountEpisodesTotalDuration() (int64, error)

func (*MediaRepository) CountMovieComments

func (r *MediaRepository) CountMovieComments() (int, error)

CountMovieComments returns the number of comments for a movie

func (*MediaRepository) CountMovieRatings

func (r *MediaRepository) CountMovieRatings() (int, error)

func (*MediaRepository) CountMoviesTotalDuration

func (r *MediaRepository) CountMoviesTotalDuration() (int64, error)

func (*MediaRepository) CountTvShowComments

func (r *MediaRepository) CountTvShowComments() (int, error)

CountTvShowComments returns the number of comments for a tv show

func (*MediaRepository) CountTvShowRatings

func (r *MediaRepository) CountTvShowRatings() (int, error)

func (*MediaRepository) CountUserMovieComments

func (r *MediaRepository) CountUserMovieComments(userID string) (int, error)

CountUserMovieComments returns the number of comments for a movie

func (*MediaRepository) CountUserMovieRatings

func (r *MediaRepository) CountUserMovieRatings(userID string) (int, error)

func (*MediaRepository) CountUserTvShowComments

func (r *MediaRepository) CountUserTvShowComments(userID string) (int, error)

CountUserTvShowComments returns the number of comments for a tv show

func (*MediaRepository) CountUserTvShowRatings

func (r *MediaRepository) CountUserTvShowRatings(userID string) (int, error)

func (*MediaRepository) DeleteMediaFile

func (r *MediaRepository) DeleteMediaFile(fileID string) error

DeleteMediaFile deletes a media file given the fileID

func (*MediaRepository) DeleteMovieComment

func (r *MediaRepository) DeleteMovieComment(commentID string) error

DeleteMovieComment deletes a movie comment

func (*MediaRepository) DeleteTvShowComment

func (r *MediaRepository) DeleteTvShowComment(commentID string) error

DeleteTvShowComment deletes a tv show comment

func (*MediaRepository) GetAvailableMoviesByRating

func (r *MediaRepository) GetAvailableMoviesByRating(page, limit, days int) ([]repository.Movie, int, error)

GetAvailableMoviesByRating returns a list of movies ordered by rating Return also the total number of results

func (*MediaRepository) GetAvailableRecentMovies

func (r *MediaRepository) GetAvailableRecentMovies(page, limit int) ([]repository.Movie, int, error)

GetAvailableRecentMovies returns a list of recently added movies

func (*MediaRepository) GetAvailableRecentTvShows

func (r *MediaRepository) GetAvailableRecentTvShows(page, limit int) ([]repository.TvShow, int, error)

GetAvailableRecentTvShows returns a list of recently added tv shows

func (*MediaRepository) GetAvailableTvShowsByRating

func (r *MediaRepository) GetAvailableTvShowsByRating(page, limit, days int) ([]repository.TvShow, int, error)

GetAvailableTvShowsByRating returns a list of tv shows ordered by rating Return also the total number of results

func (*MediaRepository) GetEpisode

func (r *MediaRepository) GetEpisode(episodeID int) (*repository.Episode, error)

GetEpisode returns an episode given the episodeID (TMDB ID)

func (*MediaRepository) GetEpisodeByFileID

func (r *MediaRepository) GetEpisodeByFileID(id string) (*repository.Episode, error)

func (*MediaRepository) GetEpisodeFileInfo

func (r *MediaRepository) GetEpisodeFileInfo(episodeID int) (*repository.MediaFile, error)

GetEpisodeFileInfo returns the file info for an episode given the episodeID (TMDB ID)

func (*MediaRepository) GetFollowedMoviesReleases

func (r *MediaRepository) GetFollowedMoviesReleases(userID string) (*[]int, error)

GetFollowedMoviesReleases returns a list of followed movies releases

func (*MediaRepository) GetFollowedTvShowsReleases

func (r *MediaRepository) GetFollowedTvShowsReleases(userID string) (*[]int, error)

GetFollowedTvShowsReleases returns a list of followed tv shows releases

func (*MediaRepository) GetMovie

func (r *MediaRepository) GetMovie(movieID int) (*repository.Movie, error)

GetMovie returns a movie given the movieID (TMDB ID)

func (*MediaRepository) GetMovieByFileID

func (r *MediaRepository) GetMovieByFileID(id string) (*repository.Movie, error)

func (*MediaRepository) GetMovieComment

func (r *MediaRepository) GetMovieComment(commentID string) (*repository.MovieComment, error)

GetMovieComment returns a movie comment

func (*MediaRepository) GetMovieComments

func (r *MediaRepository) GetMovieComments(movieID, size, page int) ([]*repository.MovieComment, int, error)

GetMovieComments returns a list of comments for a movie

func (*MediaRepository) GetMovieCommentsByRange

func (r *MediaRepository) GetMovieCommentsByRange(start, end time.Time) ([]*repository.MovieComment, error)

GetMovieCommentsByRange returns a list of comments for a movie

func (*MediaRepository) GetMovieFileInfo

func (r *MediaRepository) GetMovieFileInfo(movieID int) (*repository.MediaFile, error)

GetMovieFileInfo returns the file info for a movie given the movieID (TMDB ID)

func (*MediaRepository) GetMovieRating

func (r *MediaRepository) GetMovieRating(movieID int) (float32, int, error)

GetMovieRating returns the average rating and the number of ratings for a movie given the mediaID (TMDB ID)

func (*MediaRepository) GetMovieRatings

func (r *MediaRepository) GetMovieRatings(movieID, limit, page int) ([]*repository.MovieRating, int, error)

GetMovieRatings returns movie ratings

func (*MediaRepository) GetMoviesByComments

func (r *MediaRepository) GetMoviesByComments(present bool) (*[]int, error)

GetMoviesByComments returns a list of movies ordered by number of comments

func (*MediaRepository) GetTvShow

func (r *MediaRepository) GetTvShow(tvShowID int) (*repository.TvShow, error)

GetTvShow returns a tv show given the tvShowID (TMDB ID)

func (*MediaRepository) GetTvShowComment

func (r *MediaRepository) GetTvShowComment(commentID string) (*repository.TvShowComment, error)

GetTvShowComment returns a tv show comment

func (*MediaRepository) GetTvShowComments

func (r *MediaRepository) GetTvShowComments(tvShowID, size, page int) ([]*repository.TvShowComment, int, error)

GetTvShowComments returns a list of comments for a tv show

func (*MediaRepository) GetTvShowCommentsByRange

func (r *MediaRepository) GetTvShowCommentsByRange(start, end time.Time) ([]*repository.TvShowComment, error)

GetTvShowCommentsByRange returns a list of comments for a tv show

func (*MediaRepository) GetTvShowRating

func (r *MediaRepository) GetTvShowRating(tvShowID int) (float32, int, error)

GetTvShowRating returns the average rating and the number of ratings for a tv show given the mediaID (TMDB ID)

func (*MediaRepository) GetTvShowRatings

func (r *MediaRepository) GetTvShowRatings(tvShowID, limit, page int) ([]*repository.TvShowRating, int, error)

GetTvShowRatings returns tv show ratings

func (*MediaRepository) GetTvShowsByComments

func (r *MediaRepository) GetTvShowsByComments(present bool) (*[]int, error)

GetTvShowsByComments returns a list of tv shows ordered by number of comments

func (*MediaRepository) GetUserMovieComments

func (r *MediaRepository) GetUserMovieComments(userID string, size, page int) ([]*repository.MovieComment, int, error)

GetUserMovieComments returns a list of comments for a movie

func (*MediaRepository) GetUserMovieCommentsByRange

func (r *MediaRepository) GetUserMovieCommentsByRange(userID string, start, end time.Time) ([]*repository.MovieComment, error)

GetUserMovieCommentsByRange returns a list of comments for a movie

func (*MediaRepository) GetUserMovieRating

func (r *MediaRepository) GetUserMovieRating(userID string, movieID int) (*repository.MovieRating, error)

GetUserMovieRating returns a user's movie rating

func (*MediaRepository) GetUserMovieRatings

func (r *MediaRepository) GetUserMovieRatings(userID string, limit, page int) ([]*repository.MovieRating, int, error)

GetUserMovieRatings returns a user's movie ratings

func (*MediaRepository) GetUserTvShowComments

func (r *MediaRepository) GetUserTvShowComments(userID string, size, page int) ([]*repository.TvShowComment, int, error)

GetUserTvShowComments returns a list of comments for a tv show

func (*MediaRepository) GetUserTvShowCommentsByRange

func (r *MediaRepository) GetUserTvShowCommentsByRange(userID string, start, end time.Time) ([]*repository.TvShowComment, error)

GetUserTvShowCommentsByRange returns a list of comments for a tv show

func (*MediaRepository) GetUserTvShowRating

func (r *MediaRepository) GetUserTvShowRating(userID string, tvShowID int) (*repository.TvShowRating, error)

GetUserTvShowRating returns a user's tv show rating

func (*MediaRepository) GetUserTvShowRatings

func (r *MediaRepository) GetUserTvShowRatings(userID string, limit, page int) ([]*repository.TvShowRating, int, error)

GetUserTvShowRatings returns a user's tv show ratings

func (*MediaRepository) IsEpisodeFilePresent

func (r *MediaRepository) IsEpisodeFilePresent(episodeID int) bool

IsEpisodeFilePresent returns true if the episode file is present in the database

func (*MediaRepository) IsEpisodePresent

func (r *MediaRepository) IsEpisodePresent(episodeID int) bool

IsEpisodePresent returns true if the episode is present in the database

func (*MediaRepository) IsMovieFilePresent

func (r *MediaRepository) IsMovieFilePresent(movieID int) bool

IsMovieFilePresent returns true if the movie file is present in the database

func (*MediaRepository) IsMoviePresent

func (r *MediaRepository) IsMoviePresent(movieID int) bool

IsMoviePresent returns true if the movie is present in the database

func (*MediaRepository) IsTvShowHasEpisodeFiles

func (r *MediaRepository) IsTvShowHasEpisodeFiles(tvShowID int) bool

IsTvShowHasEpisodeFiles returns true if the tv show has episode files in the database

func (*MediaRepository) IsTvShowPresent

func (r *MediaRepository) IsTvShowPresent(tvShowID int) bool

IsTvShowPresent returns true if the tv show is present in the database

func (*MediaRepository) MediaFilesCount

func (r *MediaRepository) MediaFilesCount() (int64, error)

MediaFilesCount returns the total number of media files

func (*MediaRepository) MediaFilesTotalSize

func (r *MediaRepository) MediaFilesTotalSize() (int64, error)

MediaFilesTotalSize returns the total size of all media files

func (*MediaRepository) SaveEpisode

func (r *MediaRepository) SaveEpisode(episode *tmdb.TVEpisode) error

func (*MediaRepository) SaveMovie

func (r *MediaRepository) SaveMovie(movie *tmdb.Movie) error

func (*MediaRepository) SaveMovieRating

func (r *MediaRepository) SaveMovieRating(movieID int, userID string, rating int) (*repository.MovieRating, error)

SaveMovieRating saves a movie rating

func (*MediaRepository) SaveTvShow

func (r *MediaRepository) SaveTvShow(tvShow *tmdb.TVShow) error

func (*MediaRepository) SaveTvShowRating

func (r *MediaRepository) SaveTvShowRating(tvShowID int, userID string, rating int) (*repository.TvShowRating, error)

SaveTvShowRating saves a tv show rating

func (*MediaRepository) SearchAvailableMovies

func (r *MediaRepository) SearchAvailableMovies(page, limit int, query string) ([]repository.Movie, int, error)

SearchAvailableMovies returns a list of movies matching the search query Return also the total number of results Results are ordered by pertinence and / or rating

func (*MediaRepository) SearchAvailableTvShows

func (r *MediaRepository) SearchAvailableTvShows(page, limit int, query string) ([]repository.TvShow, int, error)

SearchAvailableTvShows returns a list of tv shows matching the search query Return also the total number of results Results are ordered by pertinence and / or rating

func (*MediaRepository) SearchEpisodeFiles

func (r *MediaRepository) SearchEpisodeFiles(query string, page, limit int) ([]*repository.Episode, int, error)

SearchEpisodeFiles returns a list of episodes given a query

func (*MediaRepository) SearchMovieFiles

func (r *MediaRepository) SearchMovieFiles(query string, page, limit int) ([]*repository.Movie, int, error)

SearchMovieFiles returns a list of movies given a query

func (*MediaRepository) UpdateMovieComment

func (r *MediaRepository) UpdateMovieComment(commentID string, content string) (*repository.MovieComment, error)

UpdateMovieComment updates a movie comment

func (*MediaRepository) UpdateTvShowComment

func (r *MediaRepository) UpdateTvShowComment(commentID string, content string) (*repository.TvShowComment, error)

UpdateTvShowComment updates a tv show comment

Jump to

Keyboard shortcuts

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