usdb-syncer 0.13.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (233) hide show
  1. usdb_syncer-0.13.0/LICENSE +21 -0
  2. usdb_syncer-0.13.0/PKG-INFO +163 -0
  3. usdb_syncer-0.13.0/README.md +130 -0
  4. usdb_syncer-0.13.0/pyproject.toml +154 -0
  5. usdb_syncer-0.13.0/src/usdb_syncer/__init__.py +81 -0
  6. usdb_syncer-0.13.0/src/usdb_syncer/_version.py +1 -0
  7. usdb_syncer-0.13.0/src/usdb_syncer/addons.py +23 -0
  8. usdb_syncer-0.13.0/src/usdb_syncer/constants.py +237 -0
  9. usdb_syncer-0.13.0/src/usdb_syncer/custom_data.py +59 -0
  10. usdb_syncer-0.13.0/src/usdb_syncer/data/.gitignore +4 -0
  11. usdb_syncer-0.13.0/src/usdb_syncer/data/__init__.py +1 -0
  12. usdb_syncer-0.13.0/src/usdb_syncer/db/__init__.py +846 -0
  13. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/1_migration.sql +164 -0
  14. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/2_migration.sql +75 -0
  15. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/3_migration.sql +8 -0
  16. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/4_migration.sql +36 -0
  17. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/5_migration.sql +11 -0
  18. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/6_migration.sql +10 -0
  19. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/__init__.py +1 -0
  20. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/insert_active_sync_meta.sql +22 -0
  21. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/insert_active_sync_metas.sql +21 -0
  22. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/insert_saved_search.sql +32 -0
  23. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/select_song_id.sql +19 -0
  24. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/select_sync_meta.sql +34 -0
  25. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/select_usdb_song.sql +54 -0
  26. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/setup_session_script.sql +15 -0
  27. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/update_saved_search.sql +35 -0
  28. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/upsert_custom_meta_data.sql +7 -0
  29. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/upsert_resource_file.sql +13 -0
  30. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/upsert_session_usdb_song.sql +8 -0
  31. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/upsert_sync_meta.sql +16 -0
  32. usdb_syncer-0.13.0/src/usdb_syncer/db/sql/upsert_usdb_song.sql +46 -0
  33. usdb_syncer-0.13.0/src/usdb_syncer/discord.py +45 -0
  34. usdb_syncer-0.13.0/src/usdb_syncer/download_options.py +163 -0
  35. usdb_syncer-0.13.0/src/usdb_syncer/errors.py +126 -0
  36. usdb_syncer-0.13.0/src/usdb_syncer/events.py +148 -0
  37. usdb_syncer-0.13.0/src/usdb_syncer/gui/__init__.py +246 -0
  38. usdb_syncer-0.13.0/src/usdb_syncer/gui/about_dialog.py +34 -0
  39. usdb_syncer-0.13.0/src/usdb_syncer/gui/comment_dialog.py +27 -0
  40. usdb_syncer-0.13.0/src/usdb_syncer/gui/custom_data_dialog.py +43 -0
  41. usdb_syncer-0.13.0/src/usdb_syncer/gui/debug_console.py +67 -0
  42. usdb_syncer-0.13.0/src/usdb_syncer/gui/ffmpeg_dialog.py +62 -0
  43. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/AboutDialog.py +150 -0
  44. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/AboutDialog.ui +182 -0
  45. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/CommentDialog.py +80 -0
  46. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/CommentDialog.ui +93 -0
  47. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/CustomDataDialog.py +74 -0
  48. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/CustomDataDialog.ui +101 -0
  49. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/DebugConsole.py +78 -0
  50. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/DebugConsole.ui +81 -0
  51. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/FfmpegDialog.py +100 -0
  52. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/FfmpegDialog.ui +158 -0
  53. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/MainWindow.py +555 -0
  54. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/MainWindow.ui +817 -0
  55. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/MetaTagsDialog.py +616 -0
  56. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/MetaTagsDialog.ui +1007 -0
  57. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/ReportDialog.py +241 -0
  58. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/ReportDialog.ui +331 -0
  59. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/SettingsDialog.py +871 -0
  60. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/SettingsDialog.ui +1223 -0
  61. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/UsdbLoginDialog.py +133 -0
  62. usdb_syncer-0.13.0/src/usdb_syncer/gui/forms/UsdbLoginDialog.ui +171 -0
  63. usdb_syncer-0.13.0/src/usdb_syncer/gui/gui_utils.py +36 -0
  64. usdb_syncer-0.13.0/src/usdb_syncer/gui/hooks.py +18 -0
  65. usdb_syncer-0.13.0/src/usdb_syncer/gui/icons.py +140 -0
  66. usdb_syncer-0.13.0/src/usdb_syncer/gui/meta_tags_dialog.py +179 -0
  67. usdb_syncer-0.13.0/src/usdb_syncer/gui/mw.py +385 -0
  68. usdb_syncer-0.13.0/src/usdb_syncer/gui/progress.py +95 -0
  69. usdb_syncer-0.13.0/src/usdb_syncer/gui/progress_bar.py +37 -0
  70. usdb_syncer-0.13.0/src/usdb_syncer/gui/report_dialog.py +203 -0
  71. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/fonts/NotoSans-Black.ttf +0 -0
  72. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/fonts/NotoSans-Bold.ttf +0 -0
  73. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/fonts/NotoSans-Regular.ttf +0 -0
  74. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/fonts/__init__.py +1 -0
  75. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/alert-white.svg +1 -0
  76. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/appicon_128x128.png +0 -0
  77. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/arc.png +0 -0
  78. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/artist-white.svg +1 -0
  79. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/artist.png +0 -0
  80. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/audio.png +0 -0
  81. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/background.png +0 -0
  82. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/balloon.png +0 -0
  83. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/bin.png +0 -0
  84. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/brave.png +0 -0
  85. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/bug-white.svg +1 -0
  86. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/bug.png +0 -0
  87. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/calendar-white.svg +1 -0
  88. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/calendar.png +0 -0
  89. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/cards-white.svg +1 -0
  90. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/check-white.svg +1 -0
  91. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/check_for_update.png +0 -0
  92. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/chevron-down-white.svg +1 -0
  93. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/chevron-left-white.svg +1 -0
  94. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/chevron-right-white.svg +1 -0
  95. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/chevron-up-white.svg +1 -0
  96. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/chrome.png +0 -0
  97. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/chromium.png +0 -0
  98. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/close-octagon-white.svg +1 -0
  99. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/cog-white.svg +1 -0
  100. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/cog.png +0 -0
  101. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/comment-white.svg +1 -0
  102. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/control-pause-local.png +0 -0
  103. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/control-pause.png +0 -0
  104. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/control-play-local.png +0 -0
  105. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/control-play.png +0 -0
  106. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/cover.png +0 -0
  107. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/database-marker-white.svg +1 -0
  108. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/database-white.svg +1 -0
  109. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/database.png +0 -0
  110. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/delete-white.svg +1 -0
  111. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/document-export.png +0 -0
  112. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/document-import.png +0 -0
  113. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/download-white.svg +1 -0
  114. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/drawer.png +0 -0
  115. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/dresser-white.svg +1 -0
  116. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/edge.png +0 -0
  117. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/edition-white.svg +1 -0
  118. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/edition.png +0 -0
  119. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/error.png +0 -0
  120. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/faviconUSDB.png +0 -0
  121. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/feather-white.svg +1 -0
  122. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/file-document-white.svg +1 -0
  123. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/file-export-white.svg +1 -0
  124. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/file-import-white.svg +1 -0
  125. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/filmstrip-white.svg +1 -0
  126. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/firefox.png +0 -0
  127. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/folder-music-white.svg +1 -0
  128. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/folder-play-white.svg +1 -0
  129. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/folder_note.png +0 -0
  130. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/format-title-white.svg +1 -0
  131. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/gold-white.svg +1 -0
  132. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/golden_notes.png +0 -0
  133. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/heart-white.svg +1 -0
  134. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/heart.png +0 -0
  135. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/id.png +0 -0
  136. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/image-area-white.svg +1 -0
  137. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/image-white.svg +1 -0
  138. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/info.png +0 -0
  139. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/information-white.svg +1 -0
  140. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/karedi.png +0 -0
  141. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/language.png +0 -0
  142. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/librewolf.png +0 -0
  143. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/log.png +0 -0
  144. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/menu-down-white.svg +1 -0
  145. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/menu-left-white.svg +1 -0
  146. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/menu-right-white.svg +1 -0
  147. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/menu-up-white.svg +1 -0
  148. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/minus-circle-white.svg +1 -0
  149. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/minus-circle.png +0 -0
  150. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/music--arrow.png +0 -0
  151. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/music-note-white.svg +1 -0
  152. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/music-white.svg +1 -0
  153. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/notebook-white.svg +1 -0
  154. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/octo_browser.png +0 -0
  155. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/opera.png +0 -0
  156. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/opera_gx.png +0 -0
  157. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/pause-white.svg +1 -0
  158. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/performous.png +0 -0
  159. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/pin-white.svg +1 -0
  160. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/pin.png +0 -0
  161. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/play-network-white.svg +1 -0
  162. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/play-white.svg +1 -0
  163. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/podium-white.svg +1 -0
  164. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/pound-box-white.svg +1 -0
  165. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/price-tag.png +0 -0
  166. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/quill.png +0 -0
  167. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/radiobox-blank-white.svg +1 -0
  168. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/radiobox-marked-white.svg +1 -0
  169. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/rating.png +0 -0
  170. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/receipt-text-white.svg +1 -0
  171. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/report.png +0 -0
  172. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/resources.py +41985 -0
  173. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/resources.qrc +129 -0
  174. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/safari.png +0 -0
  175. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/sample.png +0 -0
  176. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/spectrum-absorption.png +0 -0
  177. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/splash.afphoto +0 -0
  178. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/splash.png +0 -0
  179. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/status.png +0 -0
  180. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/sync-white.svg +1 -0
  181. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/tag-hash.png +0 -0
  182. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/tag-white.svg +1 -0
  183. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/text.png +0 -0
  184. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/tick.png +0 -0
  185. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/title.png +0 -0
  186. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/translate-variant-white.svg +1 -0
  187. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/ultrastar-manager.png +0 -0
  188. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/usdb-white.svg +27 -0
  189. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/usdx.png +0 -0
  190. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/video.png +0 -0
  191. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/views-white.svg +1 -0
  192. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/views.png +0 -0
  193. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/vivaldi.png +0 -0
  194. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/vocaluxe.png +0 -0
  195. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/warning.png +0 -0
  196. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/yass-reloaded.png +0 -0
  197. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/qt/yass.png +0 -0
  198. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/styles/__init__.py +1 -0
  199. usdb_syncer-0.13.0/src/usdb_syncer/gui/resources/styles/dark.qss +351 -0
  200. usdb_syncer-0.13.0/src/usdb_syncer/gui/search_tree/__init__.py +0 -0
  201. usdb_syncer-0.13.0/src/usdb_syncer/gui/search_tree/item.py +510 -0
  202. usdb_syncer-0.13.0/src/usdb_syncer/gui/search_tree/model.py +203 -0
  203. usdb_syncer-0.13.0/src/usdb_syncer/gui/search_tree/tree.py +160 -0
  204. usdb_syncer-0.13.0/src/usdb_syncer/gui/settings_dialog.py +349 -0
  205. usdb_syncer-0.13.0/src/usdb_syncer/gui/song_table/__init__.py +1 -0
  206. usdb_syncer-0.13.0/src/usdb_syncer/gui/song_table/column.py +243 -0
  207. usdb_syncer-0.13.0/src/usdb_syncer/gui/song_table/song_table.py +408 -0
  208. usdb_syncer-0.13.0/src/usdb_syncer/gui/song_table/table_model.py +235 -0
  209. usdb_syncer-0.13.0/src/usdb_syncer/gui/theme.py +497 -0
  210. usdb_syncer-0.13.0/src/usdb_syncer/gui/usdb_login_dialog.py +70 -0
  211. usdb_syncer-0.13.0/src/usdb_syncer/hooks.py +52 -0
  212. usdb_syncer-0.13.0/src/usdb_syncer/json_export.py +121 -0
  213. usdb_syncer-0.13.0/src/usdb_syncer/logger.py +71 -0
  214. usdb_syncer-0.13.0/src/usdb_syncer/media_player.py +16 -0
  215. usdb_syncer-0.13.0/src/usdb_syncer/meta_tags.py +254 -0
  216. usdb_syncer-0.13.0/src/usdb_syncer/path_template.py +228 -0
  217. usdb_syncer-0.13.0/src/usdb_syncer/pdf.py +234 -0
  218. usdb_syncer-0.13.0/src/usdb_syncer/postprocessing.py +348 -0
  219. usdb_syncer-0.13.0/src/usdb_syncer/remote_config.py +47 -0
  220. usdb_syncer-0.13.0/src/usdb_syncer/resource_dl.py +368 -0
  221. usdb_syncer-0.13.0/src/usdb_syncer/settings.py +1167 -0
  222. usdb_syncer-0.13.0/src/usdb_syncer/song_loader.py +749 -0
  223. usdb_syncer-0.13.0/src/usdb_syncer/song_routines.py +163 -0
  224. usdb_syncer-0.13.0/src/usdb_syncer/song_txt/__init__.py +193 -0
  225. usdb_syncer-0.13.0/src/usdb_syncer/song_txt/auxiliaries.py +115 -0
  226. usdb_syncer-0.13.0/src/usdb_syncer/song_txt/headers.py +246 -0
  227. usdb_syncer-0.13.0/src/usdb_syncer/song_txt/language_translations.py +187 -0
  228. usdb_syncer-0.13.0/src/usdb_syncer/song_txt/tracks.py +499 -0
  229. usdb_syncer-0.13.0/src/usdb_syncer/sync_meta.py +271 -0
  230. usdb_syncer-0.13.0/src/usdb_syncer/usdb_id_file.py +501 -0
  231. usdb_syncer-0.13.0/src/usdb_syncer/usdb_scraper.py +570 -0
  232. usdb_syncer-0.13.0/src/usdb_syncer/usdb_song.py +217 -0
  233. usdb_syncer-0.13.0/src/usdb_syncer/utils.py +389 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Markus Böhning
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,163 @@
1
+ Metadata-Version: 2.3
2
+ Name: usdb_syncer
3
+ Version: 0.13.0
4
+ Summary: A download manager for USDB songs.
5
+ Author: Markus Böhning
6
+ Author-email: markus.boehning@gmail.com
7
+ Requires-Python: >3.10,<3.13
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Requires-Dist: PySide6
12
+ Requires-Dist: appdirs
13
+ Requires-Dist: attrs
14
+ Requires-Dist: beautifulsoup4
15
+ Requires-Dist: ffmpeg-normalize (>=1.27)
16
+ Requires-Dist: filetype
17
+ Requires-Dist: importlib-metadata
18
+ Requires-Dist: keyring
19
+ Requires-Dist: lxml
20
+ Requires-Dist: mutagen
21
+ Requires-Dist: packaging
22
+ Requires-Dist: pillow (>=10)
23
+ Requires-Dist: reportlab
24
+ Requires-Dist: requests
25
+ Requires-Dist: rookiepy (>=0.5.3,<0.6.0)
26
+ Requires-Dist: send2trash
27
+ Requires-Dist: setuptools (>=75.8.0,<76.0.0)
28
+ Requires-Dist: unidecode
29
+ Requires-Dist: yt-dlp[curl-cffi,default]
30
+ Project-URL: Repository, https://github.com/bohning/usdb_syncer
31
+ Description-Content-Type: text/markdown
32
+
33
+ # USDB Syncer
34
+
35
+ [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
36
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
37
+ [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat)](https://pycqa.github.io/isort/)
38
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
39
+ [![Release](https://github.com/bohning/usdb_syncer/actions/workflows/release.yaml/badge.svg)](https://github.com/bohning/usdb_syncer/actions/workflows/release.yaml)
40
+ [![tox](https://github.com/bohning/usdb_syncer/actions/workflows/tox.yaml/badge.svg)](https://github.com/bohning/usdb_syncer/actions/workflows/tox.yaml)
41
+
42
+ **USDB Syncer** is an app to download and synchronize UltraStar songs hosted on [USDB](https://usdb.animux.de).
43
+ The project [extensively uses the `#VIDEO` tag](https://github.com/bohning/usdb_syncer/wiki/Meta-Tags#format) to automaticly retrieve the resources (audio, video, images, etc...) to make the UltraStar song complete.
44
+ Once a song is downloaded it can be synchronized (new notes, audio, video, images...) by redownloading the song. If a resource didn't change it's skipped.
45
+
46
+ ## Installation
47
+
48
+ There are three ways to run USDB Syncer:
49
+
50
+ 1. To run from source, see [Development](#Development).
51
+ 2. Use your favourite package manager to install the Python package, e.g. [pipx](https://pipx.pypa.io/stable/): `pipx install usdb_syncer`
52
+ 3. We provide [ready-to-run executables](https://github.com/bohning/usdb_syncer/releases) for all major operating systems.
53
+
54
+ ## Development
55
+
56
+ **USDB Syncer** is written in Python, and uses Poetry to manage its dependencies.
57
+ The following explains how to set up a development environment.
58
+
59
+ ### Prerequisites
60
+
61
+ - [git](https://www.git-scm.com/downloads)
62
+ - [Python 3.12](https://www.python.org/downloads/) (3.11 should work as well)
63
+ - [Poetry](https://python-poetry.org/docs/#installation)
64
+
65
+ ### Project Setup
66
+
67
+ Clone the project:
68
+
69
+ ```bash
70
+ git clone https://github.com/bohning/usdb_syncer.git
71
+ cd usdb_syncer
72
+ ```
73
+
74
+ <details>
75
+
76
+ <summary>If you're on <b>Linux</b>, make sure required packages for Qt are installed.</summary>
77
+
78
+ ```bash
79
+ apt install -y libgstreamer-gl1.0-0 libxcb-glx0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xfixes0 libxcb1 libxkbcommon-dev libxkbcommon-x11-0 libxcb-cursor0 libva-dev libva-drm2 libva-x11-2
80
+ ```
81
+
82
+ </details>
83
+
84
+ Now make sure the Python 3.12 environment you installed Poetry to is activated and run:
85
+
86
+ ```bash
87
+ poetry install
88
+ ```
89
+
90
+ ### Run usdb_syncer
91
+
92
+ The package has a defined entry point for the GUI. Simply type in `poetry run usdb_syncer` in your terminal.
93
+
94
+ ### Run tests
95
+
96
+ [tox](https://github.com/tox-dev/tox) makes it easy to run the full CI pipeline on your local machine, i.e., if the pipeline passes on your machine there is a good chance it will also pass on the build server.
97
+
98
+ Run `poetry run tox` to execute the test pipeline. The tox pipelines are configured in the tox.ini file.
99
+ Configurations for specific tools in the pipeline are maintained in the `pyproject.toml` file.
100
+ Tox is configured to create its own virtual environments, install test dependencies and the package you are developing, and run all tests.
101
+ If you changed the test requirements or want to perform a clean run for some reason, you can run `poetry run tox -r` to recreate tox's virtual environment.
102
+
103
+ The following tools are part of the test pipeline:
104
+
105
+ - [mypy](https://github.com/python/mypy): Statically checks your type hints.
106
+
107
+ - [ruff](https://docs.astral.sh/ruff/): A linter and code formatter.
108
+
109
+ - [pytest](https://github.com/pytest-dev/pytest): Provides a framework for functional unit tests.
110
+
111
+ - [unittest](https://docs.python.org/3/library/unittest.html): A built-in objective unittest framework
112
+ with extensive support for mocking.
113
+
114
+ If you don’t want to run the whole test pipeline, you can also use single commands from the pipeline, e.g., `poetry run pytest`. The tools will automatically pick up the correct configuration from the `pyproject.toml` file.
115
+
116
+ ## Versioning
117
+
118
+ **USDB Syncer** uses [semantic versioning (semver)](https://semver.org/) as versioning scheme.
119
+ However, since **USDB Syncer** is not a library/API but a user-facing application, we use `MAJOR`, `MINOR` and `PATCH`
120
+ versions according to the following scheme:
121
+
122
+ - `MAJOR` version increments mean a breaking change for the end user, be it the need to install additional
123
+ (3rd party) tools or changes that make it necessary to make changes to the already downloaded songs.
124
+ - `MINOR` version increments only involve adding backward compatible features.
125
+ - `PATCH` version increments bring bugfixes.
126
+
127
+ We will try to avoid `MAJOR` version increments whenever possible, but since the project is still in the
128
+ startup phase, they cannot be completely ruled out.
129
+
130
+ ## Support
131
+
132
+ <a href="https://www.buymeacoffee.com/usdbsyncer"><img src="https://img.buymeacoffee.com/button-api/?text=Buy us some vegan pizza!&emoji=🍕&slug=usdbsyncer&button_colour=40DCA5&font_colour=ffffff&font_family=Cookie&outline_colour=000000&coffee_colour=FFDD00" /></a>
133
+
134
+ ## Troubleshooting
135
+
136
+ - The `keyring` package auto-detects an appropriate installed keyring backend (see [PyPI - keyring](https://pypi.org/project/keyring/)). Thus may require following additional package if no backend can be detected, see #136
137
+
138
+ ```bash
139
+ apt install gnome-keyring
140
+ ```
141
+
142
+ If using KDE, a Wallet will have to be activated in the system settings.
143
+
144
+ - One user using KDE Plasma experiencing an [issue with the menu bar](https://github.com/bohning/usdb_syncer/issues/198)
145
+ solved it by forcing XWayland instead of Wayland being used: `env WAYLAND_DISPLAY=`.
146
+
147
+ ## Linux Distributions
148
+
149
+ Linux bundles are generated on AlmaLinux 9. They should be compatible with any modern distribution. If not, please open an issue.
150
+
151
+ The only known requirement for the binary is `glibc >= 2.34`. The current `glibc` version can be checked with:
152
+
153
+ ```bash
154
+ ldd --version
155
+ ```
156
+
157
+ Support for the following distributions has been manually confirmed as of March 2025:
158
+
159
+ - Ubuntu 22.04 and 24.04
160
+ - Debian 12
161
+ - Manjaro 24.2
162
+ - Fedora 41
163
+
@@ -0,0 +1,130 @@
1
+ # USDB Syncer
2
+
3
+ [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
4
+ [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
5
+ [![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat)](https://pycqa.github.io/isort/)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+ [![Release](https://github.com/bohning/usdb_syncer/actions/workflows/release.yaml/badge.svg)](https://github.com/bohning/usdb_syncer/actions/workflows/release.yaml)
8
+ [![tox](https://github.com/bohning/usdb_syncer/actions/workflows/tox.yaml/badge.svg)](https://github.com/bohning/usdb_syncer/actions/workflows/tox.yaml)
9
+
10
+ **USDB Syncer** is an app to download and synchronize UltraStar songs hosted on [USDB](https://usdb.animux.de).
11
+ The project [extensively uses the `#VIDEO` tag](https://github.com/bohning/usdb_syncer/wiki/Meta-Tags#format) to automaticly retrieve the resources (audio, video, images, etc...) to make the UltraStar song complete.
12
+ Once a song is downloaded it can be synchronized (new notes, audio, video, images...) by redownloading the song. If a resource didn't change it's skipped.
13
+
14
+ ## Installation
15
+
16
+ There are three ways to run USDB Syncer:
17
+
18
+ 1. To run from source, see [Development](#Development).
19
+ 2. Use your favourite package manager to install the Python package, e.g. [pipx](https://pipx.pypa.io/stable/): `pipx install usdb_syncer`
20
+ 3. We provide [ready-to-run executables](https://github.com/bohning/usdb_syncer/releases) for all major operating systems.
21
+
22
+ ## Development
23
+
24
+ **USDB Syncer** is written in Python, and uses Poetry to manage its dependencies.
25
+ The following explains how to set up a development environment.
26
+
27
+ ### Prerequisites
28
+
29
+ - [git](https://www.git-scm.com/downloads)
30
+ - [Python 3.12](https://www.python.org/downloads/) (3.11 should work as well)
31
+ - [Poetry](https://python-poetry.org/docs/#installation)
32
+
33
+ ### Project Setup
34
+
35
+ Clone the project:
36
+
37
+ ```bash
38
+ git clone https://github.com/bohning/usdb_syncer.git
39
+ cd usdb_syncer
40
+ ```
41
+
42
+ <details>
43
+
44
+ <summary>If you're on <b>Linux</b>, make sure required packages for Qt are installed.</summary>
45
+
46
+ ```bash
47
+ apt install -y libgstreamer-gl1.0-0 libxcb-glx0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xfixes0 libxcb1 libxkbcommon-dev libxkbcommon-x11-0 libxcb-cursor0 libva-dev libva-drm2 libva-x11-2
48
+ ```
49
+
50
+ </details>
51
+
52
+ Now make sure the Python 3.12 environment you installed Poetry to is activated and run:
53
+
54
+ ```bash
55
+ poetry install
56
+ ```
57
+
58
+ ### Run usdb_syncer
59
+
60
+ The package has a defined entry point for the GUI. Simply type in `poetry run usdb_syncer` in your terminal.
61
+
62
+ ### Run tests
63
+
64
+ [tox](https://github.com/tox-dev/tox) makes it easy to run the full CI pipeline on your local machine, i.e., if the pipeline passes on your machine there is a good chance it will also pass on the build server.
65
+
66
+ Run `poetry run tox` to execute the test pipeline. The tox pipelines are configured in the tox.ini file.
67
+ Configurations for specific tools in the pipeline are maintained in the `pyproject.toml` file.
68
+ Tox is configured to create its own virtual environments, install test dependencies and the package you are developing, and run all tests.
69
+ If you changed the test requirements or want to perform a clean run for some reason, you can run `poetry run tox -r` to recreate tox's virtual environment.
70
+
71
+ The following tools are part of the test pipeline:
72
+
73
+ - [mypy](https://github.com/python/mypy): Statically checks your type hints.
74
+
75
+ - [ruff](https://docs.astral.sh/ruff/): A linter and code formatter.
76
+
77
+ - [pytest](https://github.com/pytest-dev/pytest): Provides a framework for functional unit tests.
78
+
79
+ - [unittest](https://docs.python.org/3/library/unittest.html): A built-in objective unittest framework
80
+ with extensive support for mocking.
81
+
82
+ If you don’t want to run the whole test pipeline, you can also use single commands from the pipeline, e.g., `poetry run pytest`. The tools will automatically pick up the correct configuration from the `pyproject.toml` file.
83
+
84
+ ## Versioning
85
+
86
+ **USDB Syncer** uses [semantic versioning (semver)](https://semver.org/) as versioning scheme.
87
+ However, since **USDB Syncer** is not a library/API but a user-facing application, we use `MAJOR`, `MINOR` and `PATCH`
88
+ versions according to the following scheme:
89
+
90
+ - `MAJOR` version increments mean a breaking change for the end user, be it the need to install additional
91
+ (3rd party) tools or changes that make it necessary to make changes to the already downloaded songs.
92
+ - `MINOR` version increments only involve adding backward compatible features.
93
+ - `PATCH` version increments bring bugfixes.
94
+
95
+ We will try to avoid `MAJOR` version increments whenever possible, but since the project is still in the
96
+ startup phase, they cannot be completely ruled out.
97
+
98
+ ## Support
99
+
100
+ <a href="https://www.buymeacoffee.com/usdbsyncer"><img src="https://img.buymeacoffee.com/button-api/?text=Buy us some vegan pizza!&emoji=🍕&slug=usdbsyncer&button_colour=40DCA5&font_colour=ffffff&font_family=Cookie&outline_colour=000000&coffee_colour=FFDD00" /></a>
101
+
102
+ ## Troubleshooting
103
+
104
+ - The `keyring` package auto-detects an appropriate installed keyring backend (see [PyPI - keyring](https://pypi.org/project/keyring/)). Thus may require following additional package if no backend can be detected, see #136
105
+
106
+ ```bash
107
+ apt install gnome-keyring
108
+ ```
109
+
110
+ If using KDE, a Wallet will have to be activated in the system settings.
111
+
112
+ - One user using KDE Plasma experiencing an [issue with the menu bar](https://github.com/bohning/usdb_syncer/issues/198)
113
+ solved it by forcing XWayland instead of Wayland being used: `env WAYLAND_DISPLAY=`.
114
+
115
+ ## Linux Distributions
116
+
117
+ Linux bundles are generated on AlmaLinux 9. They should be compatible with any modern distribution. If not, please open an issue.
118
+
119
+ The only known requirement for the binary is `glibc >= 2.34`. The current `glibc` version can be checked with:
120
+
121
+ ```bash
122
+ ldd --version
123
+ ```
124
+
125
+ Support for the following distributions has been manually confirmed as of March 2025:
126
+
127
+ - Ubuntu 22.04 and 24.04
128
+ - Debian 12
129
+ - Manjaro 24.2
130
+ - Fedora 41
@@ -0,0 +1,154 @@
1
+ [build-system]
2
+ requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
3
+ build-backend = "poetry_dynamic_versioning.backend"
4
+
5
+ [tool.poetry]
6
+ name = "usdb_syncer"
7
+ version = "0.13.0" # will be replaced by current git tag via poetry-dynamic-versioning
8
+ authors = ["Markus Böhning <markus.boehning@gmail.com>"]
9
+ description = "A download manager for USDB songs."
10
+ readme = ["README.md"]
11
+ repository = "https://github.com/bohning/usdb_syncer"
12
+ include = [
13
+ { path = "src/usdb_syncer/gui/forms/*.py", format = ["sdist", "wheel"] },
14
+ { path = "src/usdb_syncer/gui/resources/qt/*.py", format = ["sdist", "wheel"] },
15
+ { path = "src/usdb_syncer/data/*.json", format = ["sdist", "wheel"] },
16
+ ]
17
+
18
+ [tool.poetry.requires-plugins]
19
+ poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = ["plugin"] }
20
+
21
+ [tool.poetry.dependencies]
22
+ python = ">3.10,<3.13"
23
+ appdirs = "*"
24
+ attrs = "*"
25
+ beautifulsoup4 = "*"
26
+ ffmpeg-normalize = ">=1.27"
27
+ filetype = "*"
28
+ importlib-metadata = "*"
29
+ keyring = "*"
30
+ lxml = "*"
31
+ mutagen = "*"
32
+ packaging = "*"
33
+ pillow = ">=10"
34
+ PySide6 = "*"
35
+ reportlab = "*"
36
+ requests = "*"
37
+ rookiepy = "^0.5.3"
38
+ send2trash = "*"
39
+ setuptools = "^75.8.0"
40
+ unidecode = "*"
41
+ yt-dlp = {version = "*", extras = ["default", "curl_cffi"]}
42
+
43
+ [tool.poetry.group.dev.dependencies]
44
+ tox = "*"
45
+ # lint
46
+ ruff = "0.11.6"
47
+ mypy = "*"
48
+ types-setuptools = "*"
49
+ types-requests = "*"
50
+ # test
51
+ pytest = "*"
52
+ # benchmark
53
+ snakeviz = "*"
54
+
55
+ [tool.poetry.group.build.dependencies]
56
+ PySide6 = "*" # for file generation
57
+ dunamai = "*"
58
+
59
+ [tool.poetry.group.bundle.dependencies]
60
+ pyinstaller = "*"
61
+ pyinstaller-hooks-contrib = "*"
62
+ # specifically required for pyinstaller (Note: darwin -> macos)
63
+ altgraph = "*"
64
+ macholib = {version = "*", markers="sys_platform == 'darwin'"}
65
+ pywin32-ctypes = {version = "*", markers="sys_platform == 'win32'"}
66
+
67
+ [tool.poetry.scripts]
68
+ usdb_syncer = "usdb_syncer.gui:main"
69
+
70
+ [tool.poetry-dynamic-versioning]
71
+ enable = false
72
+ substitution.files = []
73
+
74
+ [tool.ruff]
75
+ extend-exclude = [
76
+ "forms",
77
+ "resources",
78
+ ]
79
+ target-version = "py312"
80
+ preview = true
81
+
82
+ [tool.ruff.format]
83
+ skip-magic-trailing-comma = true
84
+
85
+ [tool.ruff.lint]
86
+ select = [
87
+ "A",
88
+ "B",
89
+ "BLE",
90
+ "C4",
91
+ "C90",
92
+ "COM",
93
+ "E",
94
+ "F",
95
+ "I",
96
+ "LOG",
97
+ "N",
98
+ "PTH",
99
+ "Q",
100
+ "RUF",
101
+ "S",
102
+ "TRY",
103
+ "W",
104
+ ]
105
+ ignore = [
106
+ # Since we're using the ruff formatter, we follow ruff's official guide on what
107
+ # rules to skip: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
108
+ "W191",
109
+ "E111",
110
+ "E114",
111
+ "E117",
112
+ "D206",
113
+ "D300",
114
+ "Q000",
115
+ "Q001",
116
+ "Q002",
117
+ "Q003",
118
+ "COM812",
119
+ "COM819",
120
+ # We're fine with `assert`s if they're not used for validation, but state facts
121
+ "S101",
122
+ # Allow `subprocess` and starting without shell.
123
+ "S404",
124
+ "S603",
125
+ "S606",
126
+ # Maybe investigate in the future, if it is possible to do this more safely.
127
+ "S607",
128
+ # This flags _all_ dynamic SQL constructions, so it's pointless.
129
+ "S608",
130
+ ]
131
+
132
+ # Allow fix for all enabled rules (when `--fix`) is provided.
133
+ fixable = ["ALL"]
134
+ unfixable = []
135
+
136
+ [tool.ruff.lint.isort]
137
+ # For consistency with the formatter, see https://docs.astral.sh/ruff/settings/#lint_isort_split-on-trailing-comma
138
+ split-on-trailing-comma = false
139
+
140
+ [tool.mypy]
141
+ ignore_missing_imports = true
142
+ disallow_untyped_defs = true
143
+ follow_imports = "silent"
144
+ exclude = ["src/usdb_syncer/gui/forms", "src/usdb_syncer/gui/resources"]
145
+
146
+ [tool.pyright]
147
+ # generates a lot of false positives for mutagen
148
+ reportPrivateImportUsage = false
149
+ exclude = [
150
+ "src/usdb_syncer/gui/forms",
151
+ "src/usdb_syncer/gui/resources",
152
+ "venv",
153
+ ".tox",
154
+ ]
@@ -0,0 +1,81 @@
1
+ """A download manager for USDB songs."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import base64
6
+ import binascii
7
+ import random
8
+ from pathlib import Path
9
+
10
+ from usdb_syncer import errors
11
+ from usdb_syncer._version import __version__ as __version__
12
+ from usdb_syncer.constants import Usdb
13
+
14
+
15
+ class SongId(int):
16
+ """Bounded int representing an id on USDB.
17
+
18
+ Use builtin str to get the canonical zero-padded five-digit str.
19
+ """
20
+
21
+ def __init__(self, value: int) -> None:
22
+ if value not in range(100_000):
23
+ raise errors.SongIdError(value)
24
+
25
+ def __str__(self) -> str:
26
+ return f"{self:05}"
27
+
28
+ @classmethod
29
+ def parse(cls, value: str) -> SongId:
30
+ return cls(int(value))
31
+
32
+ @classmethod
33
+ def try_parse(cls, value: str) -> SongId | None:
34
+ try:
35
+ return cls.parse(value)
36
+ except ValueError:
37
+ return None
38
+
39
+ def usdb_gettxt_url(self) -> str:
40
+ return f"{Usdb.GETTXT_URL}{self:d}"
41
+
42
+ def usdb_detail_url(self) -> str:
43
+ return f"{Usdb.DETAIL_URL}{self:d}"
44
+
45
+
46
+ class SyncMetaId(int):
47
+ """8-byte signed integer with str encoding."""
48
+
49
+ _len_bytes = 8
50
+ # chars needed to base64-encode _len_bytes bytes without padding
51
+ _len_chars = 11
52
+
53
+ @classmethod
54
+ def new(cls) -> SyncMetaId:
55
+ return cls(random.randint(-(2**63), 2**63 - 1)) # noqa: S311
56
+
57
+ def encode(self) -> str:
58
+ value = base64.urlsafe_b64encode(
59
+ self.to_bytes(self._len_bytes, "big", signed=True)
60
+ ).decode()
61
+ # strip padding
62
+ return value[:-1]
63
+
64
+ @classmethod
65
+ def decode(cls, value: str) -> SyncMetaId | None:
66
+ if len(value) != cls._len_chars:
67
+ return None
68
+ try:
69
+ number = base64.urlsafe_b64decode(f"{value}=")
70
+ except (binascii.Error, ValueError):
71
+ return None
72
+ if len(number) != cls._len_bytes:
73
+ return None
74
+ return cls.from_bytes(number, "big", signed=True)
75
+
76
+ @classmethod
77
+ def from_path(cls, path: Path) -> SyncMetaId | None:
78
+ return cls.decode(path.stem)
79
+
80
+ def to_filename(self) -> str:
81
+ return f"{self.encode()}.usdb"
@@ -0,0 +1 @@
1
+ __version__ = '0.13.0'
@@ -0,0 +1,23 @@
1
+ """Utilities for managing dynamically loaded add-ons."""
2
+
3
+ import importlib
4
+ import pkgutil
5
+ import sys
6
+
7
+ from usdb_syncer import utils
8
+ from usdb_syncer.logger import logger
9
+
10
+
11
+ def load_all() -> None:
12
+ addons_path = utils.AppPaths.addons
13
+ sys.path.append(str(addons_path))
14
+
15
+ # Search for zip files in the addons directory and add them to the path
16
+ zip_files = [str(z) for z in addons_path.glob("*.zip")]
17
+ for zip_file in zip_files:
18
+ sys.path.append(zip_file)
19
+
20
+ # Import everything
21
+ for _, mod, is_pkg in pkgutil.iter_modules([*zip_files, str(addons_path)]):
22
+ importlib.import_module(mod)
23
+ logger.debug(f"Imported add-on {'package' if is_pkg else 'module'} '{mod}'.")