#include <sbLibraryUtils.h>
Static Public Member Functions | |
static nsresult | GetItemInLibrary (sbIMediaItem *aItem, sbILibrary *aLibrary, sbIMediaItem **_retval) |
static nsresult | FindItemsWithSameURL (sbIMediaItem *aMediaItem, sbIMediaList *aMediaList, nsIMutableArray *aCopies) |
static nsresult | FindCopiesByID (sbIMediaItem *aMediaItem, sbIMediaList *aList, nsIMutableArray *aCopies) |
static nsresult | FindOriginalsByID (sbIMediaItem *aMediaItem, sbIMediaList *aList, nsIMutableArray *aCopies) |
static nsresult | GetOriginItem (sbIMediaItem *aItem, sbIMediaItem **_retval) |
static nsresult | GetContentLength (sbIMediaItem *aItem, PRInt64 *_retval=nsnull) |
static nsresult | SetContentLength (sbIMediaItem *aItem, nsIURI *aURI) |
static nsresult | GetContentURI (nsIURI *aURI, nsIURI **_retval, nsIIOService *aIOService=nsnull) |
Return a library content URI for the URI specified by aURI. A library content URI is a specially formatted URI for use within Songbird libraries and is formatted to facilitate searching for equivalent URI's (e.g., "file:" URI's are all lower case on Windows). URI's provided to createMediaItem and related methods must be library content URI's. More... | |
static nsresult | GetMediaListContentType (sbIMediaList *aMediaList, PRUint16 *aListContentType) |
Return a media list content type. More... | |
static nsresult | GetFileContentURI (nsIFile *aFile, nsIURI **_retval) |
Return a library content URI for the file specified by aFile. Special processing is required to convert an nsIFile to a library content URI (see bug 6227). getFileContentURI must be used instead of nsIIOService.newFileURI for generating library content URI's. More... | |
static nsresult | GetItemsByProperty (sbIMediaList *aMediaList, nsAString const &aPropertyName, nsAString const &aValue, nsCOMArray< sbIMediaItem > &aMediaItems) |
static nsresult | GetMediaListByContentType (sbILibrary *aLibrary, PRUint32 aContentType, nsIArray **aMediaLists) |
static PRUint32 | GetEqualOperator (sbIPropertyOperator **aOperator) |
static nsresult | SuggestUniqueNameForPlaylist (sbILibrary *aLibrary, nsAString const &aListName, nsAString &aName) |
Suggest a unique name for playlist. More... | |
static nsresult | LinkCopy (sbIMediaItem *aOriginal, sbIMediaItem *aCopy) |
Links a copy to its original. It will take into account the libraries the items belong to. It will only link from main library to non-main library. And if necessary if the copy is in the main library it will link the original to the copy. More... | |
Definition at line 96 of file sbLibraryUtils.h.
|
static |
aList is searched for items that have origin ID's that match aMediaItem's ID and items that has the same origin ID's as the aMediaItem's origin ID's
aItem | The item to find a copies of |
aList | The list to search |
Definition at line 276 of file sbLibraryUtils.cpp.
|
static |
This function search for itens in aMediaList with the same URL's. The origin URL of aMediaItem is used, if it doesn't exist then the content URL is used. aMediaList is then search by content and then origin URL
aItem | The item to find matches for |
aMediaList | The list to search in, can be a library |
Definition at line 216 of file sbLibraryUtils.cpp.
|
static |
Searches aList for items that have ID's that match aMediaItem's origin ID
aItem | The item to find a match for |
aLibrary | The library to look in |
Searches aList for items that have ID's that match aMediaItem's origin ID
aItem | The item to find a match for |
aLibrary | The library to look in |
Definition at line 345 of file sbLibraryUtils.cpp.
|
static |
Attempt to get the content length of the media item. If the content length property is not set, attempt to determine the content legnth from the content source and update the content length property.
aItem | The item to look up |
Definition at line 385 of file sbLibraryUtils.cpp.
|
static |
Return a library content URI for the URI specified by aURI. A library content URI is a specially formatted URI for use within Songbird libraries and is formatted to facilitate searching for equivalent URI's (e.g., "file:" URI's are all lower case on Windows). URI's provided to createMediaItem and related methods must be library content URI's.
aURI | URI for which to get content URI. |
aIOService | Optional IO service object |
Definition at line 512 of file sbLibraryUtils.cpp.
|
static |
Returns the equality operator for the content property
Returns the equality operator for the content property
Definition at line 814 of file sbLibraryUtils.cpp.
|
static |
Return a library content URI for the file specified by aFile. Special processing is required to convert an nsIFile to a library content URI (see bug 6227). getFileContentURI must be used instead of nsIIOService.newFileURI for generating library content URI's.
aFile | File for which to get content URI. |
Definition at line 617 of file sbLibraryUtils.cpp.
|
static |
Given an item and a library, attempt to locate a matching item in the library. Returns null (and success) if not found.
aItem | The item to find; not necessarily owned by aLibrary |
aLibrary | The library to look in |
Definition at line 171 of file sbLibraryUtils.cpp.
|
static |
|
static |
Returns the media lists matching the content type
aLibrary | the library to look for playlists |
aContentType | The content type to filter by |
aMediaLists | the returned collection of media lists |
Definition at line 775 of file sbLibraryUtils.cpp.
|
static |
Return a media list content type.
aMediaList | Media list for while to get the content type. |
Definition at line 594 of file sbLibraryUtils.cpp.
|
static |
Return the origin media item for the media item specified by aItem.
aItem | The item for which to get the origin media item. |
Definition at line 470 of file sbLibraryUtils.cpp.
|
static |
Links a copy to its original. It will take into account the libraries the items belong to. It will only link from main library to non-main library. And if necessary if the copy is in the main library it will link the original to the copy.
aOriginal | The original to link aCopy to |
aCopy | The copy to be linked |
Definition at line 907 of file sbLibraryUtils.cpp.
|
static |
Set the content length of the media item
aItem | The item to set the content length to |
aURI | The URI to retrive the content length from |
Definition at line 441 of file sbLibraryUtils.cpp.
|
static |
Suggest a unique name for playlist.
aLibrary | an sbILibrary. |
aListName | the playlist name to append id to. |
Suggest a unique name for playlist.
Definition at line 841 of file sbLibraryUtils.cpp.