python3-discogs-client 2.7.1__py3-none-any.whl → 2.8__py3-none-any.whl

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.
@@ -1,4 +1,4 @@
1
- __version__ = '2.7.1'
1
+ __version__ = '2.8'
2
2
  __version_info__ = tuple(int(i) for i in __version__.split('.') if i.isdigit())
3
3
 
4
4
  from discogs_client.client import Client
discogs_client/models.py CHANGED
@@ -745,7 +745,7 @@ class CollectionFolder(PrimaryAPIObject):
745
745
  count = SimpleField() #:
746
746
 
747
747
  def __init__(self, client, dict_):
748
- super(CollectionFolder, self).__init__(client, dict_)
748
+ super().__init__(client, dict_)
749
749
 
750
750
  @property
751
751
  def releases(self):
@@ -754,14 +754,34 @@ class CollectionFolder(PrimaryAPIObject):
754
754
 
755
755
  def add_release(self, release):
756
756
  release_id = release.id if isinstance(release, Release) else release
757
- add_release_url = self.fetch('resource_url') + '/releases/{}'.format(release_id)
758
- self.client._post(add_release_url, None)
757
+ resource_url = self.fetch('resource_url')
758
+ self.client._post(f"{resource_url}/releases/{release_id}", None)
759
759
 
760
760
  def remove_release(self, instance):
761
+ """Remove a collection item entirely.
762
+ """
761
763
  if not isinstance(instance, CollectionItemInstance):
762
764
  raise TypeError('instance must be of type CollectionItemInstance')
763
- instance_url = self.fetch('resource_url') + '/releases/{0}/instances/{1}'.format(instance.id, instance.instance_id)
764
- self.client._delete(instance_url)
765
+ resource_url = self.fetch('resource_url')
766
+ self.client._delete(f"{resource_url}/releases/{instance.id}/instances/{instance.instance_id}")
767
+
768
+ def move_release(self, instance, target_folder_id):
769
+ """Move a collection item to another folder.
770
+
771
+ Moving to folder id 1 moves to the "Uncategorized" folder.
772
+ """
773
+ if not isinstance(instance, CollectionItemInstance):
774
+ raise TypeError('instance must be of type CollectionItemInstance')
775
+ resource_url = self.fetch('resource_url')
776
+ self.client._post(
777
+ f"{resource_url}/releases/{instance.id}/instances/{instance.instance_id}",
778
+ {"folder_id": target_folder_id},
779
+ )
780
+
781
+ def uncategorize_release(self, instance):
782
+ """Move a collection item to the "Uncategorized" folder.
783
+ """
784
+ self.move_release(instance, 1)
765
785
 
766
786
  def __repr__(self):
767
787
  return '<CollectionFolder {0!r} {1!r}>'.format(self.id, self.name)
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: python3-discogs-client
3
- Version: 2.7.1
3
+ Version: 2.8
4
4
  Summary: Python API client for Discogs
5
5
  Home-page: https://github.com/joalla/discogs_client
6
6
  Author: joalla
@@ -18,8 +18,16 @@ Requires-Dist: requests
18
18
  Requires-Dist: oauthlib
19
19
  Requires-Dist: python-dateutil
20
20
  Provides-Extra: docs
21
- Requires-Dist: sphinx ; extra == 'docs'
22
- Requires-Dist: pydata-sphinx-theme ; extra == 'docs'
23
- Requires-Dist: myst-parser ; extra == 'docs'
21
+ Requires-Dist: sphinx; extra == "docs"
22
+ Requires-Dist: pydata-sphinx-theme; extra == "docs"
23
+ Requires-Dist: myst-parser; extra == "docs"
24
+ Dynamic: author
25
+ Dynamic: author-email
26
+ Dynamic: classifier
27
+ Dynamic: description
28
+ Dynamic: home-page
29
+ Dynamic: provides-extra
30
+ Dynamic: requires-dist
31
+ Dynamic: summary
24
32
 
25
33
  This is an active fork of the official "Discogs API client for Python", which was deprecated by discogs.com as of June 2020. We think it is a very useful Python module and decided to continue maintaining it. Please visit: https://github.com/joalla/discogs_client for more information.
@@ -0,0 +1,11 @@
1
+ discogs_client/__init__.py,sha256=C9ullFtCV-fYGz8NEWw3eGx5RgPJfApsDo3YdqG3q-c,445
2
+ discogs_client/client.py,sha256=AqQmwJd54DrAFTnTb4zi1jCefjC6sbISh43FZuYsQ0g,7632
3
+ discogs_client/exceptions.py,sha256=7kHj2wbpfT0gLE7uqm6c4aS28Wkr58f6u9jfpcT_NSM,1323
4
+ discogs_client/fetchers.py,sha256=D8npYWt9FILSRIhVsUdA6N0pzRCEUFh5hqQbnBu4IUg,11964
5
+ discogs_client/models.py,sha256=bjonpqmZ_homR51vQnOe7xiAJrrl0T6F8QfthhiskvQ,32564
6
+ discogs_client/utils.py,sha256=r0Hh8JHu8T3XZciEg0mAVV_fN7aZhUZIB08CBY5jJMM,3515
7
+ python3_discogs_client-2.8.dist-info/LICENSE,sha256=GvYq7dzLVxNCGN29xn0Ec1JMpzZwPXzOAdtZsuB9pUI,1455
8
+ python3_discogs_client-2.8.dist-info/METADATA,sha256=Gh5aPbAZqHMpuaVmmmsXW1A3J-Jr4YRvMpsIz84gJ1I,1245
9
+ python3_discogs_client-2.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
10
+ python3_discogs_client-2.8.dist-info/top_level.txt,sha256=jgqsRXqG3dJuCOSykXhXN68DMNu77XYQuqgqlPSSv1E,15
11
+ python3_discogs_client-2.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.5.0)
2
+ Generator: setuptools (75.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,11 +0,0 @@
1
- discogs_client/__init__.py,sha256=F8H5pGOgcXj6mYUVTcdSDB2D4RMDRCkxkDa9K-kkKRI,447
2
- discogs_client/client.py,sha256=AqQmwJd54DrAFTnTb4zi1jCefjC6sbISh43FZuYsQ0g,7632
3
- discogs_client/exceptions.py,sha256=7kHj2wbpfT0gLE7uqm6c4aS28Wkr58f6u9jfpcT_NSM,1323
4
- discogs_client/fetchers.py,sha256=D8npYWt9FILSRIhVsUdA6N0pzRCEUFh5hqQbnBu4IUg,11964
5
- discogs_client/models.py,sha256=c6OfCIEPW7HtOpegP3tcdGPtEBTm7adDxWyQzcfe52M,31844
6
- discogs_client/utils.py,sha256=r0Hh8JHu8T3XZciEg0mAVV_fN7aZhUZIB08CBY5jJMM,3515
7
- python3_discogs_client-2.7.1.dist-info/LICENSE,sha256=GvYq7dzLVxNCGN29xn0Ec1JMpzZwPXzOAdtZsuB9pUI,1455
8
- python3_discogs_client-2.7.1.dist-info/METADATA,sha256=K7KOJllZVlacHkNgdH0mxKpX9of5ueTqC2HkOf6Sgb8,1088
9
- python3_discogs_client-2.7.1.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
10
- python3_discogs_client-2.7.1.dist-info/top_level.txt,sha256=jgqsRXqG3dJuCOSykXhXN68DMNu77XYQuqgqlPSSv1E,15
11
- python3_discogs_client-2.7.1.dist-info/RECORD,,