Simulator of version 2.2+ doesn't discover my music

RESOLVED WONTFIX

Status

RESOLVED WONTFIX
3 years ago
8 months ago

People

(Reporter: nazar, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
Firefox OS Simulator of version 2.1- nicely detects all my music from profile's music directory (like ~/Music), but 2.2+ simulator doesn't.

Ubuntu 15.10 x64.
Tried fake-sdcard, doesn't work at all.
(Reporter)

Updated

3 years ago
OS: Gonk (Firefox OS) → Linux
Hardware: ARM → x86_64

Updated

3 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
I checked the nightly b2g desktop build.

2014-12-15 (ver 2.2)[1] : it can search from ~/Music
2014-12-16 (ver 2.2)[2] : it can't search from ~/Music

[1] ftp://ftp.mozilla.org/pub/b2g/nightly/2014/12/2014-12-15-04-02-01-mozilla-central/
[2] ftp://ftp.mozilla.org/pub/b2g/nightly/2014/12/2014-12-16-04-02-05-mozilla-central/
Created attachment 8644797 [details]
bug1184472-test.zip

I created minimum test application.

The result of this test application different from 2.1 and 2.2 .

---------------------------------------------------
  storage = navigator.getDeviceStorage("music");
  var cursor = storage.enumerate();
  cursor.onsuccess = function() {
    var file = this.result;
    console.log(file);
  }
---------------------------------------------------
[Firefox 2.1 Simulator Result]
File { size: 1120146, type: "audio/mpeg", name: "jazz_03.mp3", path: "", lastModifiedDate: Date 2015-07-28T08:04:36.206Z, mozFullPath: "C:\Users\manta\Music\jazz_03.mp3" }

[Firefox 2.2 Simulator Result]
undefined 
    at cursor.onsuccess (app://6eeec604-fb5b-48c1-afbd-0849311e3e72/js/app.js:14:4)
Perhaps, this problem was occurred from bug 996619.
After bug 996619, 'device.storage.overrideRootDir' is setting Profile's directory.(attachment 8536477 [details] [diff] [review])

So, nsDeviceStorage is overriding a preference value.[1]

However, MDN document wrote as follow.[2]
> Note: this is mostly meant for API testing. Music will be read not from the "fake-sdcard" directory, 
> but from your system's ~/Music, pictures from ~/Pictures, videos from ~/Videos. Downloads go to ~/Downloads.
> user-dirs.dirs redefinitions are supported.

janx:
Does this behavior which not reading from user-dirs is correct?
I think that should override directory in case of device.storage.testing is true or reference sdcard/apps/crashes directories.
What do you think this behavior?

[1] https://dxr.mozilla.org/mozilla-central/rev/d6ea652c579992daa9041cc9718bb7c6abefbc91/dom/devicestorage/nsDeviceStorage.cpp#1083
[2] https://developer.mozilla.org/en-US/docs/Tools/Firefox_OS_Simulator#SD_card_emulation
Flags: needinfo?(janx)
Thank you for investigating this, Mantaroh!

Alex, there might be a music discovery problem with the new way we simulate storage. I don't really like the old way of discoving content (not in fake-sdcard, but in the user's home dir) because it feels weird privacy-wise.

Maybe all simulator content discovery should come from the fake-sdcard? Then we could also modify the MDN entry.
Flags: needinfo?(poirot.alex)
Flags: needinfo?(janx)
My overall plan was to make it so that WebIDE would redirect all simulators it runs to a single, shared, storage directory, used for all the API that are related to storage.

So, the current behavior, if that's really what happens, is expected.
All storages should be map to the `storage` folder, within each simulator profile folder.
This is quite terrible as, unless you find the related MDN page, you don't know about this one.
The discoverability of this is terrible.

Ideally, we would make it clear from WebIDE, that storages are mapped to one directory and easily discover/open it from it. And also, you would be able to change to anything you want.
Flags: needinfo?(poirot.alex)

Comment 6

8 months ago
Firefox OS is not being worked on
Status: NEW → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.