C# Class DataAccess.PlayerAccess

Exibir arquivo Open project: mysteryx93/NaturalGroundingPlayer

Public Methods

Method Description
GetVideoByFileName ( string fileName ) : Media
GetVideoById ( System.Guid videoId ) : Media
GetVideoByTitle ( string artist, string title ) : Media
SelectRandomId ( IQueryable query, int count, int &totalFound ) : List

Selects random videos from query result while giving higher priority to videos with higher preference.

SelectVideo ( IQueryable data, SearchSettings settings, int count, Media maintainCurrent ) : List

Return a random video from the database matching specified conditions.

SelectVideo ( SearchSettings settings, int count, Media maintainCurrent ) : List

Return a random video from the database matching specified conditions.

VideoMatchesConditions ( Media video, SearchSettings settings ) : bool

Returns whether specified video matches specified conditions.

Private Methods

Method Description
PreferenceToInt ( double preference ) : int

Returns an integer representation of the preference field where its weight grows exponentially.

Method Details

GetVideoByFileName() public static method

public static GetVideoByFileName ( string fileName ) : Media
fileName string
return Media

GetVideoById() public static method

public static GetVideoById ( System.Guid videoId ) : Media
videoId System.Guid
return Media

GetVideoByTitle() public static method

public static GetVideoByTitle ( string artist, string title ) : Media
artist string
title string
return Media

SelectRandomId() public static method

Selects random videos from query result while giving higher priority to videos with higher preference.
public static SelectRandomId ( IQueryable query, int count, int &totalFound ) : List
query IQueryable The query returning the list of videos to chose from.
count int The amount of videos to select.
totalFound int The total amount of videos matching the query.
return List

SelectVideo() public static method

Return a random video from the database matching specified conditions.
public static SelectVideo ( IQueryable data, SearchSettings settings, int count, Media maintainCurrent ) : List
data IQueryable The list of videos in which to search; generally Entities.Media.
settings SearchSettings An object containing various search settings.
count int The quantity of results to return.
maintainCurrent Media If specified, the currently selected video will be kept.
return List

SelectVideo() public static method

Return a random video from the database matching specified conditions.
public static SelectVideo ( SearchSettings settings, int count, Media maintainCurrent ) : List
settings SearchSettings An object containing various search settings.
count int The quantity of results to return.
maintainCurrent Media If specified, the currently selected video will be kept.
return List

VideoMatchesConditions() public static method

Returns whether specified video matches specified conditions.
public static VideoMatchesConditions ( Media video, SearchSettings settings ) : bool
video Media The video to evaluate.
settings SearchSettings An object containing various search settings.
return bool