(name string)
| 140 | } |
| 141 | |
| 142 | func classifyOpenCategory(name string) string { |
| 143 | switch strings.ToLower(filepath.Ext(name)) { |
| 144 | case ".txt", ".md", ".markdown", ".log", ".json", ".yaml", ".yml", ".toml", ".ini", ".cfg", ".conf", ".csv", |
| 145 | ".go", ".rs", ".py", ".js", ".ts", ".tsx", ".jsx", ".java", ".c", ".cc", ".cpp", ".h", ".hpp", ".sh", ".zsh": |
| 146 | return openCategoryText |
| 147 | case ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".heic", ".tiff": |
| 148 | return openCategoryImage |
| 149 | case ".mp4", ".mkv", ".mov", ".avi", ".wmv", ".flv", ".webm", ".m4v": |
| 150 | return openCategoryVideo |
| 151 | case ".mp3", ".flac", ".wav", ".aac", ".m4a", ".ogg", ".opus": |
| 152 | return openCategoryAudio |
| 153 | case ".pdf": |
| 154 | return openCategoryPDF |
| 155 | default: |
| 156 | return openCategoryDefault |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | func remoteVideoOpenURL(file *api.File) string { |
| 161 | for _, media := range file.Medias { |
no outgoing calls