Comments (3)
So, the reasons I'm not particularly happy about MediaBaseUrl are the following:
- I'm unclear what problem it's trying to solve. Using MediaBaseUrl for the Fedora XML metadata the file size is reduced by 2%, but simply gzipping it it reduces by a further 60% (which is what we do with the XML metadata) and as a consequence it actually loads faster than the uncompressed metadata. If the argument is that it makes it easier to re-write the URL, you're no better off then just rewriting each URL as you still have to load and resave the entire file anyway.
- It's unclear how to implement this. Does MediaBaseUrl supplement remote screenshots without a prefix (which incidentally makes them filenames or paths, not URLs), or does it overwrite all the remote screenshots? If it's the former then it's not actually a way to set up a screenshot mirror. Derivatives can't just rsync the screenshots and change the MediaBaseUrl as they need to produce AppStream metadata themselves to avoid the screenshots and the references in the files changing.
- It makes it hard to merge files, due to unclear semantics of MediaBaseUrl we just have to remove it and make the URLs full, which kinda negates the purpose of the tag in the first place.
- It's not clear what "media" it's prefixing; do remote icons get checked too?
- It's going to increase the RSS for any files that use MediaBaseUrl and decrease the parsing speed for both files that do and files that don't.
- I don't see how it can be used in a multiple mirror setup as you can only specify one URL for the MediaBaseUrl; it's not even useful for round-robin functionality.
from appstream-glib.
- I'm unclear what problem it's trying to solve. Using MediaBaseUrl for the Fedora XML metadata the file size is reduced by 2%, but simply gzipping it it reduces by a further 60% (which is what we do with the XML metadata) and as a consequence it actually loads faster than the uncompressed metadata. If the argument is that it makes it easier to re-write the URL, you're no better off then just rewriting each URL as you still have to load and resave the entire file anyway.
Still, in case I want to rewrite the URL, I would have to go through the whole file, know the previous URL and string-replace it with the new URL. By having MediaBaseUrl, I just have to change one field.
Also, it permits having a list of mirrors somewhere from which data can be selected, so you just need to concatenate the mirror-url and the URL piece found in the DEP-11 document.
*It's unclear how to implement this. Does MediaBaseUrl supplement remote screenshots without a prefix (which incidentally makes them filenames or paths, not URLs), or does it overwrite all the remote screenshots? If it's the former then it's not actually a way to set up a screenshot mirror. Derivatives can't just rsync the screenshots and change the MediaBaseUrl as they need to produce AppStream metadata themselves to avoid the screenshots and the references in the files changing.
No sure what you mean here... Thing is: If there is a MediaBaseUrl field in the document, all remote URLs are relative to the url. So if MediaBaseUrl is "http://example.org", a screenshot "url" will be "a/ab/abcde.desktop/image.png" and the baseurl will just be added to that.
There is no mixing of MediaBaseUrl with full URLs, it's an all-or-nothing approach.
- It makes it hard to merge files, due to unclear semantics of MediaBaseUrl we just have to remove it and make the URLs full, which kinda negates the purpose of the tag in the first place.
Why would you want to merge files? We don't do that with DEP-11 data, so it's kind of irrelevant. And yes, you would remove the MediaBaseUrl from the resulting file on a merge and use full URLs, which isn't a problem, since the default case is non-merged, "pure" DEP-11 YAML documents, and not merged ones.
- It's not clear what "media" it's prefixing; do remote icons get checked too?
Yes - didn't I state that already? Although, right now, remote icons aren't used, so this mainly affects screenshots.
- It's going to increase the RSS for any files that use MediaBaseUrl and decrease the parsing speed for both files that do and files that don't.
Why? When I implemented this in libappstream, it didn't impact parsing speed at all, since it's just a string to hold in memory, and a couple of extra string concatenantions if the string is found to be non-NULL when reading remote media.
- I don't see how it can be used in a multiple mirror setup as you can only specify one URL for the MediaBaseUrl; it's not even useful for round-robin functionality.
That will happen in future, probably (e.g. by having a list of mirrors in the header). It's more to have an extensible specification from the beginning.
from appstream-glib.
This is fixed now, thanks Robert!
from appstream-glib.
Related Issues (20)
- Allowing passing unknown attributes HOT 8
- Update license list to include OFL-1.1-RFN HOT 1
- Please document news-to-appdata script HOT 8
- New Release HOT 4
- as-self-test fails since 0.8.0 HOT 5
- RFE: port to gtk4 and libsoup-3.0 HOT 2
- as-app-validate.c fails to initialize GProxyResolver before using it HOT 1
- Crashes when trying to check remote assets HOT 5
- Segfaults validating falkon appdata HOT 8
- Make validate complain if there's two <releases> tags HOT 3
- Screenshot maximum size is arbitrary and not mentioned in the spec HOT 2
- Error reporting of 'appstream-util validate' is too vague. HOT 4
- generated appdata doesn't contain an icon when id doesn't contain .desktop suffix
- Support more icon sizes HOT 7
- <recommends> tag support HOT 7
- Is Appstream-buider suitable to use with local mirror to make appstream metadata ? HOT 2
- RFE: is it possible to start making github releases?🤔 HOT 1
- Duplicated data detected while there is none HOT 1
- Appstream-builder might be mishandling license strings HOT 5
- FTBFS on ubuntu 24.04 due to yaml content type detection in test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appstream-glib.