QutEcoacoustics / baw-server

The acoustic workbench server for storing and managing ecoacoustic data. Manages the structure and audio data. Provides an API for clients access.
Apache License 2.0
9 stars 4 forks source link

Analysis Result file list `path` and `name` semantics #272

Closed atruskie closed 8 years ago

atruskie commented 8 years ago

Take the following snippets of valid JSON returned from https://staging.ecosounds.org/analysis_jobs/system/audio_recordings/187684/ and https://staging.ecosounds.org/analysis_jobs/system/audio_recordings/187684/Towsey.Acoustic:

{

    "path": "/",
    "name": "/",
    "type": "directory",
    "children": [
        {
            "path": "log.txt",
            "name": "log.txt",
            "type": "file",
            "size_bytes": 196054,
            "mime": "text/plain"
        },
        {
            "path": "Towsey.Acoustic.yml",
            "name": "Towsey.Acoustic.yml",
            "type": "file",
            "size_bytes": 1968,
            "mime": "application/x-yaml"
        },
        {
            "path": "Towsey.Acoustic",
            "name": "Towsey.Acoustic",
            "type": "directory",
            "has_children": true
        }
    ]

}
{

    "path": "Towsey.Acoustic",
    "name": "Towsey.Acoustic",
    "type": "directory",
    "children": [
        {
            "path": "Towsey.Acoustic/4c77b524-1857-4550-afaa-c0ebe5e3960a_20101012-140000Z__IndexGenerationData.json",
            "name": "4c77b524-1857-4550-afaa-c0ebe5e3960a_20101012-140000Z__IndexGenerationData.json",
            "type": "file",
            "size_bytes": 217,
            "mime": "application/json"
        }
        …
    ]
}

The following inconsistencies should be addressed:

Assuming yes on the previous point:

Thoughts?

One last point: the path field seems a little redundant in our datasets. Perhaps path could be removed for all file type objects as the full path can be determined by parent directory path + filename

cofiem commented 8 years ago

From discussion:

atruskie commented 8 years ago

:+1: