@@ -1922,24 +1922,6 @@ private void onRemoveFileOperationFinish(RemoveFileOperation operation, RemoteOp
19221922 }
19231923 }
19241924
1925- private void onRemoveAlbumOperationFinish (RemoveAlbumOperation operation , RemoteOperationResult result ) {
1926-
1927- if (result .isSuccess ()) {
1928-
1929- Fragment fragment = getSupportFragmentManager ().findFragmentByTag (AlbumItemsFragment .Companion .getTAG ());
1930- if (fragment instanceof AlbumItemsFragment albumItemsFragment ) {
1931- albumItemsFragment .onAlbumDeleted ();
1932- }
1933- } else {
1934- DisplayUtils .showSnackMessage (this , ErrorMessageAdapter .getErrorCauseMessage (result , operation , getResources ()));
1935-
1936- if (result .isSslRecoverableException ()) {
1937- mLastSslUntrustedServerResult = result ;
1938- showUntrustedCertDialog (mLastSslUntrustedServerResult );
1939- }
1940- }
1941- }
1942-
19431925 private void onRestoreFileVersionOperationFinish (RemoteOperationResult result ) {
19441926 if (result .isSuccess ()) {
19451927 OCFile file = getFile ();
@@ -2014,26 +1996,6 @@ private void onCopyFileOperationFinish(CopyFileOperation operation, RemoteOperat
20141996 }
20151997 }
20161998
2017- private void onCopyAlbumFileOperationFinish (CopyFileToAlbumOperation operation , RemoteOperationResult result ) {
2018- if (result .isSuccess ()) {
2019- // when item added from inside of Album
2020- Fragment fragment = getSupportFragmentManager ().findFragmentByTag (AlbumItemsFragment .Companion .getTAG ());
2021- if (fragment instanceof AlbumItemsFragment albumItemsFragment ) {
2022- albumItemsFragment .refreshData ();
2023- } else {
2024- // files added directly from Media tab
2025- DisplayUtils .showSnackMessage (this , "File added successfully" );
2026- }
2027- Log_OC .e (TAG , "Files copied successfully" );
2028- } else {
2029- try {
2030- DisplayUtils .showSnackMessage (this , ErrorMessageAdapter .getErrorCauseMessage (result , operation , getResources ()));
2031- } catch (NotFoundException e ) {
2032- Log_OC .e (TAG , "Error while trying to show fail message " , e );
2033- }
2034- }
2035- }
2036-
20371999 /**
20382000 * Updates the view associated to the activity after the finish of an operation trying to rename a file.
20392001 *
@@ -2086,24 +2048,6 @@ private void onRenameFileOperationFinish(RenameFileOperation operation, RemoteOp
20862048 }
20872049
20882050
2089- private void onRenameAlbumOperationFinish (RenameAlbumOperation operation , RemoteOperationResult result ) {
2090- if (result .isSuccess ()) {
2091-
2092- Fragment fragment = getSupportFragmentManager ().findFragmentByTag (AlbumItemsFragment .Companion .getTAG ());
2093- if (fragment instanceof AlbumItemsFragment albumItemsFragment ) {
2094- albumItemsFragment .onAlbumRenamed (operation .getNewAlbumName ());
2095- }
2096-
2097- } else {
2098- DisplayUtils .showSnackMessage (this , ErrorMessageAdapter .getErrorCauseMessage (result , operation , getResources ()));
2099-
2100- if (result .isSslRecoverableException ()) {
2101- mLastSslUntrustedServerResult = result ;
2102- showUntrustedCertDialog (mLastSslUntrustedServerResult );
2103- }
2104- }
2105- }
2106-
21072051 private void onSynchronizeFileOperationFinish (SynchronizeFileOperation operation , RemoteOperationResult result ) {
21082052 if (result .isSuccess () && operation .transferWasRequested ()) {
21092053 OCFile syncedFile = operation .getLocalFile ();
@@ -2138,6 +2082,62 @@ private void onCreateFolderOperationFinish(CreateFolderOperation operation, Remo
21382082 }
21392083 }
21402084
2085+ private void onRemoveAlbumOperationFinish (RemoveAlbumOperation operation , RemoteOperationResult result ) {
2086+
2087+ if (result .isSuccess ()) {
2088+
2089+ Fragment fragment = getSupportFragmentManager ().findFragmentByTag (AlbumItemsFragment .Companion .getTAG ());
2090+ if (fragment instanceof AlbumItemsFragment albumItemsFragment ) {
2091+ albumItemsFragment .onAlbumDeleted ();
2092+ }
2093+ } else {
2094+ DisplayUtils .showSnackMessage (this , ErrorMessageAdapter .getErrorCauseMessage (result , operation , getResources ()));
2095+
2096+ if (result .isSslRecoverableException ()) {
2097+ mLastSslUntrustedServerResult = result ;
2098+ showUntrustedCertDialog (mLastSslUntrustedServerResult );
2099+ }
2100+ }
2101+ }
2102+
2103+ private void onCopyAlbumFileOperationFinish (CopyFileToAlbumOperation operation , RemoteOperationResult result ) {
2104+ if (result .isSuccess ()) {
2105+ // when item added from inside of Album
2106+ Fragment fragment = getSupportFragmentManager ().findFragmentByTag (AlbumItemsFragment .Companion .getTAG ());
2107+ if (fragment instanceof AlbumItemsFragment albumItemsFragment ) {
2108+ albumItemsFragment .refreshData ();
2109+ } else {
2110+ // files added directly from Media tab
2111+ DisplayUtils .showSnackMessage (this , getResources ().getString (R .string .album_file_added_message ));
2112+ }
2113+ Log_OC .e (TAG , "Files copied successfully" );
2114+ } else {
2115+ try {
2116+ DisplayUtils .showSnackMessage (this , ErrorMessageAdapter .getErrorCauseMessage (result , operation , getResources ()));
2117+ } catch (NotFoundException e ) {
2118+ Log_OC .e (TAG , "Error while trying to show fail message " , e );
2119+ }
2120+ }
2121+ }
2122+
2123+ private void onRenameAlbumOperationFinish (RenameAlbumOperation operation , RemoteOperationResult result ) {
2124+ if (result .isSuccess ()) {
2125+
2126+ Fragment fragment = getSupportFragmentManager ().findFragmentByTag (AlbumItemsFragment .Companion .getTAG ());
2127+ if (fragment instanceof AlbumItemsFragment albumItemsFragment ) {
2128+ albumItemsFragment .onAlbumRenamed (operation .getNewAlbumName ());
2129+ }
2130+
2131+ } else {
2132+ DisplayUtils .showSnackMessage (this , ErrorMessageAdapter .getErrorCauseMessage (result , operation , getResources ()));
2133+
2134+ if (result .isSslRecoverableException ()) {
2135+ mLastSslUntrustedServerResult = result ;
2136+ showUntrustedCertDialog (mLastSslUntrustedServerResult );
2137+ }
2138+ }
2139+ }
2140+
21412141 private void onCreateAlbumOperationFinish (CreateNewAlbumOperation operation , RemoteOperationResult result ) {
21422142 if (result .isSuccess ()) {
21432143 Fragment fragment = getSupportFragmentManager ().findFragmentByTag (AlbumsFragment .Companion .getTAG ());
0 commit comments