// IsMediaAllowed returns whether the specified media is allowed
IsMediaAllowed returns whether the specified media is allowed
// IsMediaAllowed returns whether the specified media is allowed
func IsMediaAllowed(node sqalx.Node, mediaType MediaType, ytVideoID string) (bool, error) {
	s := sdb.Select()
	switch mediaType {
	case MediaTypeYouTubeVideo:
		s = s.Where(sq.And{
			sq.Eq{"disallowed_media.media_type": string(mediaType)},
			sq.Eq{"disallowed_media.yt_video_id": ytVideoID},
		})
	default:
		return false, stacktrace.NewError("invalid media type")
	}
	m, _, err := getDisallowedMediaWithSelect(node, s)
	if err != nil {
		return false, stacktrace.Propagate(err, "")
	}
	return len(m) == 0, nil
}
func IsMediaAllowed ( node sqalx . Node , mediaType MediaType , ytVideoID string ) ( bool , error ) { s := sdb . Select ( ) switch mediaType { case MediaTypeYouTubeVideo : s = s . Where ( sq . And { sq . Eq { " " : string ( mediaType ) } , sq . Eq { " " : ytVideoID } , } ) default : return false , stacktrace . NewError ( " " ) } m , _ , err := getDisallowedMediaWithSelect ( node , s ) if err != nil { return false , stacktrace . Propagate ( err , " " ) } return len ( m ) == 0 , nil }
IsMediaAllowed returns whether the specified media is allowed
IsMediaAllowed returns whether the specified media is allowed