1# Media Library Kit Changelog 2 3## cl.medialibrary.1 Changed the Behavior of Certain APIs in @ohos.file.photoAccessHelper 4 5**Access Level** 6 7Public API 8 9**Reason for Change** 10 11To make the asset storage logic clearer, the mappings between assets and albums in the media library are modified. Previously, an image or video can exist in multiple logical albums through mapping, but now each photo can belong to only one physical album. 12 13**Change Impact** 14 15This change is a non-compatible change. 16 171. Adding assets to an album with **addAssets** 18 19 Before: The assets obtained from query are directly added. 20 21 After: A copy of the asset is added. 22 232. Removing assets from an album with **removeAssets** 24 25 Before: The mapping between the album and asset is removed. 26 27 After: The asset is moved to the recycle bin. 28 293. Setting the album name with **setAlbumName** and **commitModify** 30 31 Before: The album_name attribute of the album is directly changed. 32 33 After: The album is deleted, and a new one with the same metadata is created with the new name. 34 354. Registering a listener for the specified URI with **registerChange** 36 37 Before: The listener is registered for the asset URI obtained from query, and notifications are sent to that asset URI for any additions, deletions, or modifications. 38 39 After: Operations such as Add and Remove are performed on the copies. Therefore, notifications are sent to the copy URI. 40 41 42**Start API Level** 43 4410 and API 11 45 46**Change Since** 47 48OpenHarmony 5.0.0.43 49 50**Key API/Component Changes** 51 521. Adding assets to an album: addAssets(assets: Array\<PhotoAsset>): void 53 542. Removing assets from an album: removeAssets(assets: Array\<PhotoAsset>): void 55 563. Setting the album name: 57 58 setAlbumName(name: string):void, 59 60 commitModify(callback: AsyncCallback\<void>): void 61 624. Registering a listener for a specified URI: registerChange(uri: string, forChildUris: boolean, callback: Callback\<ChangeData>): void 63 64**Adaptation Guide** 65 66The API usage does not change, and no additional adaptation is required during API calls. However, since the API behavior changes, you should pay attention to the changes and make appropriate adjustments. 67 681. When **addAssets** is used to add a photo, the copy instead of the original photo is added to the album. Any subsequent operations on the asset should be performed on the copied asset within the album. 69 702. When using **removeAssets**, note that the asset is moved to the recycle bin. 71 723. When using **deleteAlbums**, note that all assets within the album are moved to the recycle bin. 73 744. When renaming an album with **setAlbumName** and **commitModify**, the original album is deleted and a new one is created. To continue working with the album, you should perform operations on the new album. After renaming, call [getAlbums](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper.md#getalbums-2) to obtain the new album name for subsequent operations. 75 765. When using **registerChange**, note that you will receive notifications for the addition of copied assets when **addAssets** is called, deletion notifications for assets within the album when **removeAssets** and **deleteAlbums** are called, and update notifications for the album when **setAlbumName** and **commitModify** are called. 77