Giter Site home page Giter Site logo

Comments (12)

nkalupahana avatar nkalupahana commented on June 12, 2024 1

Here's what I think I can do -- I'll implement #74, so that way you have a getAlbumsPath() function that tells you where your app's albums are. That way, instead of just checking albums by name, you can also make sure the album identifier starts with the albums path (i.e. it's an album stored in the writeable albums path). If there isn't one there (e.g. they updated their phone and now they have a different albums path because of android version), you'll know to re-create the album.

from media.

amakh avatar amakh commented on June 12, 2024 1

Hey @nkalupahana, I tested the example app and didn't have the issue. I found the issue. What i was doing: I search for my YOOBIC album in the getAlbums, to get the identifier. If i don't find it, I create a new YOOBIC album. The path of my YOOBIC album was this one :  "/storage/emulated/0/Pictures/YOOBIC" ➝ As i don't have access to pictures with the new API we're targeting (33), i'm getting a permission denial for wanting to save my picture inside this YOOBIC folder. Deleting my folder and re-creating it from the createAlbum function worked fine on android 10 & 13. Now my album is inside Android/media. Do you think it's possible to add on your side a property on the album objects to know if we can write inside those folders or no ? for now we just found a workaround to rename this folder to a new name to use the createAlbum for everyone.

I'm curious, did you ask your users to rename the folder themselves? And even if you rename the folder, half of the medias are stored in this old folder and the rest will be stored in the new one. Or maybe did you find a workaround to merge / transfer the albums?

Hey @amakh , we're waiting for the gelAlbumsPath() to have access to the folders where we can actually write into. At the same time we just renamed the name of the album where we will store our medias, so that it will create a new album for all the users of the app in a storage folder where we can write into.

Ok I see, thank you. Some of our users were asking why they couldn't find medias in the old album (they didn't check other paths or they were pointing the initial folder to be sync by other tools).
I guess we will just continue to answer to them telling to use the new album now.

from media.

jarabito11 avatar jarabito11 commented on June 12, 2024

I have the same problem. I need help please.

from media.

nkalupahana avatar nkalupahana commented on June 12, 2024

Should be fixed on 5.3.1, please confirm.

from media.

mfschieber avatar mfschieber commented on June 12, 2024

Hey @nkalupahana , thank you for helping on this issue 🙏

I tested latest version on my android 10, and i still have the issue RuntimeException occurred, and now the photo is not downloaded anymore.
Here is the issue i have on the plugin side :
Screenshot 2023-12-06 at 10 05 47

When storage permission was required, i accepted it, but i still have this permission denial after that. I'm trying to save my picture on an existing 'YOOBIC' folder.

Issue is not reproducible on android 13.

from media.

jarabito11 avatar jarabito11 commented on June 12, 2024

@nkalupahana This is my code:

 let params;
    if(this.platform.is('ios')){
      params = {
        path: fileUrl
      };
    }else{
      let album = await this.getAlbumIdentifier();
      console.log(album);
      
      if (!album.success){
        this.tools.showToast('No se ha encontrado ningún album en el dispositivo.');
        return;
      }

      params = {
        path: fileUrl,
        albumIdentifier: album.identifier
      };
    }

    Media.saveVideo(params).then((res) => {
      this.tools.showToast('Vídeo descargado.');
    }).catch((err) => {
      console.error(err);
      this.tools.showToast('Ha ocurrido un error al descargar el vídeo.');
    }).finally(() => {
      loader.dismiss();
    });

but I have this error:

Captura de pantalla 2023-12-06 a las 10 32 38

@mfschieber is the same problem

from media.

nkalupahana avatar nkalupahana commented on June 12, 2024

Can you both try the example app in the example folder? This is what I use to debug issues, and it currently works for me on the Android 10 emulator. This will help me narrow down the issue.

If it is still broken on the example app, let me know what order you need to press buttons on the example app to reproduce the crash.

from media.

mfschieber avatar mfschieber commented on June 12, 2024

Hey @nkalupahana, I tested the example app and didn't have the issue. I found the issue. What i was doing: I search for my YOOBIC album in the getAlbums, to get the identifier. If i don't find it, I create a new YOOBIC album. The path of my YOOBIC album was this one :  "/storage/emulated/0/Pictures/YOOBIC" ➝ As i don't have access to pictures with the new API we're targeting (33), i'm getting a permission denial for wanting to save my picture inside this YOOBIC folder.
Deleting my folder and re-creating it from the createAlbum function worked fine on android 10 & 13. Now my album is inside Android/media.
Do you think it's possible to add on your side a property on the album objects to know if we can write inside those folders or no ? for now we just found a workaround to rename this folder to a new name to use the createAlbum for everyone.

from media.

mfschieber avatar mfschieber commented on June 12, 2024

thanks @nkalupahana , would be nice ! i'm suscribing to this feature to test that when it's ready 👍

from media.

amakh avatar amakh commented on June 12, 2024

Hey @nkalupahana, I tested the example app and didn't have the issue. I found the issue. What i was doing: I search for my YOOBIC album in the getAlbums, to get the identifier. If i don't find it, I create a new YOOBIC album. The path of my YOOBIC album was this one :  "/storage/emulated/0/Pictures/YOOBIC" ➝ As i don't have access to pictures with the new API we're targeting (33), i'm getting a permission denial for wanting to save my picture inside this YOOBIC folder. Deleting my folder and re-creating it from the createAlbum function worked fine on android 10 & 13. Now my album is inside Android/media. Do you think it's possible to add on your side a property on the album objects to know if we can write inside those folders or no ? for now we just found a workaround to rename this folder to a new name to use the createAlbum for everyone.

I'm curious, did you ask your users to rename the folder themselves? And even if you rename the folder, half of the medias are stored in this old folder and the rest will be stored in the new one. Or maybe did you find a workaround to merge / transfer the albums?

from media.

mfschieber avatar mfschieber commented on June 12, 2024

Hey @nkalupahana, I tested the example app and didn't have the issue. I found the issue. What i was doing: I search for my YOOBIC album in the getAlbums, to get the identifier. If i don't find it, I create a new YOOBIC album. The path of my YOOBIC album was this one :  "/storage/emulated/0/Pictures/YOOBIC" ➝ As i don't have access to pictures with the new API we're targeting (33), i'm getting a permission denial for wanting to save my picture inside this YOOBIC folder. Deleting my folder and re-creating it from the createAlbum function worked fine on android 10 & 13. Now my album is inside Android/media. Do you think it's possible to add on your side a property on the album objects to know if we can write inside those folders or no ? for now we just found a workaround to rename this folder to a new name to use the createAlbum for everyone.

I'm curious, did you ask your users to rename the folder themselves? And even if you rename the folder, half of the medias are stored in this old folder and the rest will be stored in the new one. Or maybe did you find a workaround to merge / transfer the albums?

Hey @amakh , we're waiting for the gelAlbumsPath() to have access to the folders where we can actually write into. At the same time we just renamed the name of the album where we will store our medias, so that it will create a new album for all the users of the app in a storage folder where we can write into.

from media.

nkalupahana avatar nkalupahana commented on June 12, 2024

getAlbumsPath() has been added in 5.4.0, and the example code has been updated to use it. If you need any help with this, please open a new issue!

from media.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.