Files
OpenSpace/data/assets/examples/urlsynchronization.asset
T
Andreas Engberg f3c4fc54db Update UrlSynchronization to limit amount of downloads (#2586) (#2933)
Limits the number of URL synchronization downloads by time stamping files for X seconds fixes (#2586). 
Also, show the amount of downloaded data as soon as the download is started fix (#2460)

* Adds time validity to UrlSynchronized files (#2586)

Updated affected asset files. Satellite asset files lasts for 24h by default now. Other assets are updated to work as before. Obs timestamp is computed using UTC time.

* Code cleanup

* Update httpsynchronization.cpp

* Applied suggestions from code review

* Update multi-line comment to `//`

* Remove accidental commas in .asset files

Co-authored-by: Emma Broman <emma.broman@liu.se>

* Fixed PR comments + bug in .asset file

* Refactor code

* Reports downloaded data as early as possible, fixes (#2460)

* More files

---------

Co-authored-by: Alexander Bock <alexander.bock@liu.se>
Co-authored-by: Emma Broman <emma.broman@liu.se>
2023-11-14 17:08:38 +01:00

81 lines
2.5 KiB
Lua

asset.resource({
Name = "Example Single",
Type = "UrlSynchronization",
Identifier = "example_single",
Url = "http://celestrak.com/NORAD/elements/geo.txt"
})
asset.resource({
Name = "Example Multiple",
Type = "UrlSynchronization",
Identifier = "example_multiple",
Url = {
"http://celestrak.com/NORAD/elements/stations.txt",
"http://celestrak.com/NORAD/elements/gps-ops.txt"
}
})
asset.resource({
Name = "Example Large",
Type = "UrlSynchronization",
Identifier = "example_large",
Url = {
"http://speedtest.tele2.net/1000GB.zip",
"https://speedtest.tele2.net/100GB.zip",
"https://speedtest.tele2.net/50GB.zip",
"http://speedtest.tele2.net/10GB.zip",
"http://speedtest.tele2.net/1GB.zip",
"http://speedtest.tele2.net/100MB.zip",
"https://proof.ovh.net/files/10Gb.dat",
"https://proof.ovh.net/files/1Gb.dat",
"https://proof.ovh.net/files/100Mb.dat",
"https://speed.hetzner.de/10GB.bin",
"https://speed.hetzner.de/1GB.bin",
"https://speed.hetzner.de/100MB.bin",
"http://ipv4.download.thinkbroadband.com/1GB.zip",
"http://ipv4.download.thinkbroadband.com/512MB.zip",
"http://ipv4.download.thinkbroadband.com/200MB.zip",
"http://ipv4.download.thinkbroadband.com/100MB.zip",
"http://ipv4.download.thinkbroadband.com/50MB.zip",
"http://ipv4.download.thinkbroadband.com/20MB.zip",
"http://ipv4.download.thinkbroadband.com/10MB.zip",
"http://ipv4.download.thinkbroadband.com/5MB.zip",
},
SecondsUntilResync = 0
})
asset.resource({
Name = "Example Medium",
Type = "UrlSynchronization",
Identifier = "example_medium",
Url = "http://ipv4.download.thinkbroadband.com/5MB.zip",
SecondsUntilResync = 0
})
-- Load a resource without hashing, meaning that the bare directory name will be
-- used for the downloaded file. If UseHash is true, the hash of the URL is appended
-- to the directory name to produce a unique directory under all circumstances
asset.resource({
Name = "Example No Hash",
Type = "UrlSynchronization",
Identifier = "no_hash",
Url = "http://wms.itn.liu.se/Mercury/Messenger_Mosaic/Messenger_Mosaic.wms",
UseHash = false
})
asset.meta = {
Name = "UrlSynchronization",
Version = "1.0",
Description = [[Example showing how to load resources (any type of data file) from
online sources, using the UrlSynchronization resource type. These can then be used
in other assets. See more information on resources on the OpenSpace wiki page.
]],
Author = "OpenSpace Team",
URL = "http://openspaceproject.com",
License = "MIT license"
}