(&self)
| 1111 | } |
| 1112 | |
| 1113 | pub async fn get_published_public_plugins(&self) -> ConfigStoreResult<Vec<Plugin>> { |
| 1114 | let raw_plugins = sqlx::query_as!( |
| 1115 | DbPlugin, |
| 1116 | r#"SELECT id, |
| 1117 | created_at, |
| 1118 | name, |
| 1119 | short_description, |
| 1120 | long_description, |
| 1121 | is_published, |
| 1122 | is_official, |
| 1123 | plugin_kind, |
| 1124 | current_version_number, |
| 1125 | script_published_source, |
| 1126 | script_published_version_updated_at, |
| 1127 | script_dev_source, |
| 1128 | script_dev_version_updated_at, |
| 1129 | author_id, |
| 1130 | is_public, |
| 1131 | discord_thread_id, |
| 1132 | installed_guilds, |
| 1133 | installed_guilds_updated_at |
| 1134 | FROM plugins WHERE is_published = true AND is_public = true |
| 1135 | ORDER BY id ASC"#, |
| 1136 | ) |
| 1137 | .fetch_all(&self.pool) |
| 1138 | .await?; |
| 1139 | |
| 1140 | let mut res: Vec<Plugin> = Vec::new(); |
| 1141 | for plugin in raw_plugins.into_iter() { |
| 1142 | let images = self.get_plugin_images_with_pool(plugin.id as u64).await?; |
| 1143 | res.push(PluginAndImages(plugin, images).into()); |
| 1144 | } |
| 1145 | |
| 1146 | Ok(res) |
| 1147 | } |
| 1148 | |
| 1149 | pub async fn try_guild_add_script_plugin( |
| 1150 | &self, |
no test coverage detected