mirror of
https://github.com/immich-app/immich.git
synced 2025-11-13 04:02:35 +09:00
Show all albums an asset appears in on the asset viewer page (#575)
* Add route to query albums for a specific asset * Update API and add to detail-panel * Fix tests * Refactor API endpoint * Added alt attribute to img tag Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -1457,10 +1457,11 @@ export const AlbumApiAxiosParamCreator = function (configuration?: Configuration
|
||||
/**
|
||||
*
|
||||
* @param {boolean} [shared]
|
||||
* @param {string} [assetId] Only returns albums that contain the asset Ignores the shared parameter undefined: get all albums
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getAllAlbums: async (shared?: boolean, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
getAllAlbums: async (shared?: boolean, assetId?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
||||
const localVarPath = `/album`;
|
||||
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
||||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
||||
@@ -1481,6 +1482,10 @@ export const AlbumApiAxiosParamCreator = function (configuration?: Configuration
|
||||
localVarQueryParameter['shared'] = shared;
|
||||
}
|
||||
|
||||
if (assetId !== undefined) {
|
||||
localVarQueryParameter['assetId'] = assetId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
||||
@@ -1684,11 +1689,12 @@ export const AlbumApiFp = function(configuration?: Configuration) {
|
||||
/**
|
||||
*
|
||||
* @param {boolean} [shared]
|
||||
* @param {string} [assetId] Only returns albums that contain the asset Ignores the shared parameter undefined: get all albums
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
async getAllAlbums(shared?: boolean, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<AlbumResponseDto>>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.getAllAlbums(shared, options);
|
||||
async getAllAlbums(shared?: boolean, assetId?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<AlbumResponseDto>>> {
|
||||
const localVarAxiosArgs = await localVarAxiosParamCreator.getAllAlbums(shared, assetId, options);
|
||||
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
||||
},
|
||||
/**
|
||||
@@ -1784,11 +1790,12 @@ export const AlbumApiFactory = function (configuration?: Configuration, basePath
|
||||
/**
|
||||
*
|
||||
* @param {boolean} [shared]
|
||||
* @param {string} [assetId] Only returns albums that contain the asset Ignores the shared parameter undefined: get all albums
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
*/
|
||||
getAllAlbums(shared?: boolean, options?: any): AxiosPromise<Array<AlbumResponseDto>> {
|
||||
return localVarFp.getAllAlbums(shared, options).then((request) => request(axios, basePath));
|
||||
getAllAlbums(shared?: boolean, assetId?: string, options?: any): AxiosPromise<Array<AlbumResponseDto>> {
|
||||
return localVarFp.getAllAlbums(shared, assetId, options).then((request) => request(axios, basePath));
|
||||
},
|
||||
/**
|
||||
*
|
||||
@@ -1890,12 +1897,13 @@ export class AlbumApi extends BaseAPI {
|
||||
/**
|
||||
*
|
||||
* @param {boolean} [shared]
|
||||
* @param {string} [assetId] Only returns albums that contain the asset Ignores the shared parameter undefined: get all albums
|
||||
* @param {*} [options] Override http request option.
|
||||
* @throws {RequiredError}
|
||||
* @memberof AlbumApi
|
||||
*/
|
||||
public getAllAlbums(shared?: boolean, options?: AxiosRequestConfig) {
|
||||
return AlbumApiFp(this.configuration).getAllAlbums(shared, options).then((request) => request(this.axios, this.basePath));
|
||||
public getAllAlbums(shared?: boolean, assetId?: string, options?: AxiosRequestConfig) {
|
||||
return AlbumApiFp(this.configuration).getAllAlbums(shared, assetId, options).then((request) => request(this.axios, this.basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user