-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plugins without GitHub releases show up at bottom of datasette.io/plugins #148
Comments
I can fall back on their releases dates from the PyPI packages table here: https://datasette.io/content/pypi_releases?_sort=md5_digest&package__startswith=datasette-sqlite- |
I can fix this SQL view: https://datasette.io/content/plugins CREATE VIEW plugins AS select
repos.name as name,
repos.full_name as full_name,
users.login as owner,
repos.description as description,
plugin_repos.extra_search as extra_search,
plugin_repos.tags as tags,
repos.stargazers_count,
pypi_versions.name as tag_name,
max(pypi_releases.upload_time) as latest_release_at,
repos.created_at as created_at,
datasette_repos.openGraphImageUrl,
datasette_repos.usesCustomOpenGraphImage,
(
select
sum(downloads)
from
stats
where
stats.package = repos.name
and stats.date > date('now', '-7 days')
) as downloads_this_week,
(
select
count(*)
from
plugin_repos
where
repo = repos.full_name
) as is_plugin,
(
select
count(*)
from
tool_repos
where
repo = repos.full_name
) as is_tool
from
datasette_repos
join repos on datasette_repos.id = repos.node_id
left join pypi_releases on pypi_releases.package = repos.name
left join pypi_versions on pypi_releases.version = pypi_versions.id
join users on users.id = repos.owner
join plugin_repos on plugin_repos.repo = datasette_repos.nameWithOwner
group by
repos.id
order by
latest_release_at desc; |
Huh... Here's the problem: left join pypi_releases on pypi_releases.package = repos.name This fails because in the case of Alex's |
Yeah, the problem is that the But the package name doesn't match that repo name. |
... and the repo name is the thing used in this YAML file: Lines 355 to 384 in 99430d7
|
Two possible solutions:
I'm going to try that nasty hack first. |
from
datasette_repos
join repos on datasette_repos.id = repos.node_id
left join pypi_releases on (
pypi_releases.package = repos.name or pypi_releases.package = 'datasette-' || repos.name
)
left join pypi_versions on pypi_releases.version = pypi_versions.id
join users on users.id = repos.owner
join plugin_repos on plugin_repos.repo = datasette_repos.nameWithOwner
|
Currently: https://datasette.io/plugins sorts by "most recent release" by default, which means that plugins that don't use GitHub releases show up at the bottom of the page:
The text was updated successfully, but these errors were encountered: