(&self, plugin_ids: &[u64])
| 1036 | } |
| 1037 | |
| 1038 | pub async fn get_plugins(&self, plugin_ids: &[u64]) -> ConfigStoreResult<Vec<Plugin>> { |
| 1039 | let ids = plugin_ids.iter().map(|v| *v as i64).collect::<Vec<_>>(); |
| 1040 | let raw_plugins = sqlx::query_as!( |
| 1041 | DbPlugin, |
| 1042 | r#"SELECT id, |
| 1043 | created_at, |
| 1044 | name, |
| 1045 | short_description, |
| 1046 | long_description, |
| 1047 | is_published, |
| 1048 | is_official, |
| 1049 | plugin_kind, |
| 1050 | current_version_number, |
| 1051 | script_published_source, |
| 1052 | script_published_version_updated_at, |
| 1053 | script_dev_source, |
| 1054 | script_dev_version_updated_at, |
| 1055 | author_id, |
| 1056 | is_public, |
| 1057 | discord_thread_id, |
| 1058 | installed_guilds, |
| 1059 | installed_guilds_updated_at |
| 1060 | FROM plugins WHERE id = ANY($1) |
| 1061 | ORDER BY id ASC"#, |
| 1062 | &ids, |
| 1063 | ) |
| 1064 | .fetch_all(&self.pool) |
| 1065 | .await?; |
| 1066 | |
| 1067 | let mut res: Vec<Plugin> = Vec::new(); |
| 1068 | for plugin in raw_plugins.into_iter() { |
| 1069 | let images = self.get_plugin_images_with_pool(plugin.id as u64).await?; |
| 1070 | res.push(PluginAndImages(plugin, images).into()); |
| 1071 | } |
| 1072 | |
| 1073 | Ok(res) |
| 1074 | } |
| 1075 | |
| 1076 | pub async fn get_user_plugins(&self, user_id: u64) -> ConfigStoreResult<Vec<Plugin>> { |
| 1077 | let raw_plugins = sqlx::query_as!( |
no test coverage detected