Gjsify LogoGjsify Logo

Index

Functions

  • bufferToJpeg(buffer: number, len: number, bufferMime: string, target: string): boolean
  • This function performs the same operation as media_art_file_to_jpeg() with the exception that a raw buffer can be used instead providing len and the buffer_mime too.

    Parameters

    • buffer: number

      Raw buffer representing content to save

    • len: number

      Length of buffer to use

    • bufferMime: string

      MIME type for buffer

    • target: string

      Output file name (not URI) to save converted content to

    Returns boolean

  • fileToJpeg(filename: string, target: string): boolean
  • Save filename to target as JPEG format. The filename may not be a JPEG in the first place.

    Parameters

    • filename: string

      Original file name (not URI) to convert

    • target: string

      Output file name (not URI) to save converted content to

    Returns boolean

  • Gets the files pointing to cache files suitable for storing the media art provided by the artist, title and file arguments. cache_file will point to a location in the XDG user cache directory, meanwhile local_file will point to a cache file that resides in the same filesystem than file.

    The file provided is required if local_file is to be returned. The local_file relates to a location on the media the local file system or media storage it is found on, so for example, if you have a mounted volume with MP3s on it in file:///media/martyn/pendrive, the local_file will point to a URI that looks like file:///media/martyn/pendrive/.mediaartlocal/....

    The cache_file is very different to the local_file, the cache_file relates to a symlink stored in XDG cache directories for the user. A cache_file would be expected to look like file:///home/martyn/.cache/media-art/.... This is normally the location that is most useful (assuming the cache has been extracted in the first place).

    When done, both #GFiles must be freed with g_object_unref() if non-%NULL.

    Parameters

    • artist: string

      the artist

    • title: string

      the title

    • prefix: string

      the prefix for cache files, for example "album"

    • file: Gio.File

      a #GFile representing the actual media art or %NULL

    Returns [boolean, Gio.File, Gio.File]

  • getPath(artist: string, title: string, prefix: string, uri: string): [boolean, string, string]
  • This function calls media_art_get_file() by creating a #GFile for uri and passing the same arguments to media_art_get_file(). For more details about what this function does, see media_art_get_file().

    Get the path to media art for a given resource. Newly allocated data returned in cache_path and local_uri must be freed with g_free().

    Parameters

    • artist: string

      the artist

    • title: string

      the title

    • prefix: string

      the prefix, for example "album"

    • uri: string

      the uri of the file or %NULL

    Returns [boolean, string, string]

  • pluginInit(maxWidth: number): void
  • This function facilitates a plugin's need to create any internal caches before anything else is done. This function must exist in each plugin and is called immediately after the plugin is loaded. Conversely, media_art_plugin_shutdown() is called before tear down of the plugin system or plugin itself.

    Parameters

    • maxWidth: number

      The maximum width that an image is allowed to be

    Returns void

  • pluginShutdown(): void
  • This function facilitates a plugin's need to clean up any internal caches. This function must exist in each plugin and is called immediately after the plugin is loaded. Conversely, media_art_plugin_init() is called after the plugin is loaded.

    Returns void

  • remove(artist: string, album: string): boolean
  • Removes media art for given album/artist provided.

    Parameters

    • artist: string

      artist the media art belongs to

    • album: string

      album the media art belongs or %NULL

    Returns boolean

  • stripInvalidEntities(original: string): string
  • Strip a albumname or artistname string to prepare it for calculating the media art path with it. Certain characters and charactersets will be stripped and a newly allocated string returned which you must free with g_free().

    This functions is used internally by media_art_get_file() and media_art_get_path(). You will not normally need to call it yourself.

    This function provides the following features:

    1. Invalid characters include: ()[]<>{}_!#$^&*+=|/"'?~;
    2. Text inside brackets of (), {}, [] and <> pairs are removed.
    3. Multiples of space characters are removed.

    Parameters

    • original: string

      original string

    Returns string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method